I'd like to rollback a change I made recently in TFS. In Subversion, this was pretty straightforward. However, it seems to be an incredible headache in TFS:
Option 1: Get Prior Version
- Manually get prior version of each file
- Check out for edit
- Fail - the checkout (in VS2008) forces me to get the latest version
Option 2: Get TFS Power Tools
- Download Team Foundation Power Tools
- Issue rollback command from cmd line
- Fail - it won't work if there are any other pending changes
Option 3: Manually Undo Changes
- manually undo my changes, then commit a new changeset
Question
How do I rollback to a previous changeset in TFS?
Rollback has been moved from tfpt.exe to tf.exe, the Team Foundation Version Control Tool.
using TFS powertools is the best way http://rajputyh.blogspot.com/2008/08/change-set-rollback-using-tfs-power.html
The solution above is for TFS2008. TFS2010 has built-in rollback feature. see this article for details.
Your solution #1 will work: 1. manually get prior version of each file
check out for edit
Checkin the file and Ignore server changes when prompted.
The reason why it failed for you is because you must have the "Get latest version of item on check out" option turned on. Turn this option off by going to Tools...Options...Source Control...Visual Studio Tema Foundation Server and unchecking "Get latest version of item on check out"
Cheers
If you did 1 check-in and you just want to undo it, that has a changeset # associated with it. Do a history on the folder in question to see the bad changeset. Open it up to see the details (all files changed, etc).
I believe that you can restore or undo a changeset from that screen, but my Visual Studio just crashed when I tried to do this. /sigh -- I definitely share your pain.
Where do I downmod TFS on this site?
Not having a rollback option is actually feature of TFS ;)
To rollback changes:
And now all your intermediate changesets before the rollback are saved as well! What a great feature!