Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rollback a single file in TFS

Tags:

tfs

If I view the history of a single file in source control I can right hand click a change-set in the list and choose "rollback back entire change-set".

Will this rollback all the other files I checked in during that checkin or just the file I am currently viewing? If it does rollback all files is there a way to rollback just the file selected?

Thanks

like image 350
Hoody Avatar asked Nov 16 '12 16:11

Hoody


People also ask

How do I rollback a file in TFS?

Ribbon Select Source Control > View History. Right-Click If you have the File List open, right-click the file you want to roll back and select Source Control > View History. Source Control Explorer With the Pending Changes pane open, right-click the file you want to roll back and select View History.

How do I roll back multiple changesets in TFS?

To roll back a changeset from the History windowIn the History window, select two or more consecutive versions, open their shortcut menu, and choose Rollback.

How do I revert a file in Visual Studio?

In the current version, you find in the Explorer, in the left sidebar. Then Open Editors, and right click on the file you want to revert.


2 Answers

As previously mentioned, rolling back the changeset rolls it back in its entirety.

Installing Team Foundation Power Tools (which I think pretty much everyone should install) gives you another option: If you want to rollback a single file, you can right click a single file in the Source Control Explorer and select Rollback...

like image 73
Assaf Stone Avatar answered Sep 20 '22 13:09

Assaf Stone


Yes, rolling back the entire changeset will roll back all the changes in it.

However, a Rollback is not instant, when you click that option the rollback will be perform a reverse merge and leave the changes in your workspace. So you can look at them in Pending Changes.

In your case, just perform the Rollback and then undo everything except the file you actually want to Rollback.

like image 30
DaveShaw Avatar answered Sep 18 '22 13:09

DaveShaw