Friday 21 October 2016

Revert bad checkin in tfs

Problem:
When working on one of the project I checked in some wrong code and relaised that I need to rollback to previous version.

Solution:

Right click the folder/file (the one to revert) and click view history and find the last changeset number you like to revert to. Open Visual Studio Command Prompt (Run as administrator) and write the following command

Preferred (worked for me)

tf rollback /toversion:C<<write your previous changeset number you like to rever to>> /recursive <<path to folder>>

e.g.
tf rollback /toversion:C378 /recursive c:\tfs\dev1\projectxyz

(use . to use the current working space for this)


tf rollback /changeset: <<write your previous changeset number you like to revert to>>

e.g.

tf rollback /changeset:378

No comments:

Post a Comment