I am looking to create an "undo" mechanism for a TFS work item using the TFS API - this will undo committed changes. Basically, after saving new data (also using the API) to the work item, I would like the option to revert the WorkItem back to the previous version.
Pseudo code something like this...
1)Get current Work Item for Id:xxxxxx
2)Get "revision id" of this latest work item and store in "PreviousRevId"
3)Modify field values
4)Save
5)For whatever reason we don't want these changes any more (domain logic as to reasons are excluded for brevity)
6)Revert to old revision ("PreviousRevId") and make it the current (latest) revision