I am struggling with TFS for reverting a check-in which happened by mistake(some how checked out files of other solution got checked in with a different solution, don’t know how it happened. I just intended to check-in one file so its not possible that I didn’t saw other 10 files checked). So obviously I had to revert all the changes happened in this change set and restore the previous version. I started looking for such feature in TFS but couldn’t find anything close. I came across these posts, mentioning Power Toys for TFS so I decided to install them but I was not able to achieve what I wanted.
I came across this article explaining how to revert files manually(one by one); but following the steps provided in article nothing happened. TFS was not showing any pending changes.
Finally after trying a lot I was able to revert the changes, hufff…
Here are the steps which worked for me -
Step 1: Check out the file you need to revert:
Step 2: Get the specific version you need to revert to:
Remember to select the two checkboxes for Overwrite, otherwise changes won’t reflect:
Step 3: You will be prompted for conflicts(although we haven’t made any change, just checked it out, how dumb :( )
Clicking on “Auto Merge All” will do.
Step 4: Compare the files and you will see the changes you want to revert to -
So, I thought everything is done and I will have to just check in the code. But to my surprise I got this Resolve conflicts box. Actually it makes sense but I am fed up of all this ;))
Step 5: Select “Discard Server Changes” and again check in the files.
Yuppie finally changes are reverted, congratulations and thanks a lot TFS for helping me out and making my Life so easy, ha ha ha.
I am wondering whether having a direct option to revert a change set present in TFS itself was that tough or is it something else which prevented MS from adding that !!