Rolling back a change set in TFS

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:

image

image

Step 2: Get the specific version you need to revert to:

image

Remember to select the two checkboxes for Overwrite, otherwise changes won’t reflect:

image 

image

image

 Step 3: You will be prompted for conflicts(although we haven’t made any change, just checked it out, how dumb :( )

image

Clicking on “Auto Merge All” will do.

Step 4: Compare the files and you will see the changes you want to revert to -

image

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 ;))

image

Step 5: Select “Discard Server Changes” and again check in the files.

image

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 !!

Ref:

http://stackoverflow.com/questions/32607/how-do-i-rollback-a-tfs-check-in

2 Comments

  • So you need to check-out to roll back. What if I want an entire solution from a well known points. Do I have to check out the entire solution. In all other version control system you just click and say get me this version to this place, and it just does it. It seems the version management in TFS version control is nothing short of terrible.

  • It's working fine.

    Thanks,

Add a Comment

As it will appear on the website

Not displayed

Your website