Also available at

Also available at my website http://tosh.me/ and on Twitter @toshafanasiev

Monday, 20 June 2011

Rolling back to a previous version TFS

Reverting your codebase to a previous version isn't something that the Visual Studio TFS tools seem to support ( or at least, not that I've seen ).

To achieve this you can use the tf utility (http://msdn.microsoft.com/en-us/library/cc31bk2e(v=vs.80).aspx), as follows:

tf rollback /toversion:123123 ./*.cs /recursive

where rollback is the command, 123123 is the changeset to which you want to revert, ./*.cs is a file filter to control the kind of files that are reverted ( they call this an 'itemspec' in the documentation ) and as such can be set to anything - *.vb, * etc. The /recursive flag is pretty self-explanatory.

tf checkin /comment:"rolling back to version 123123" .

will then check your changes in ( although that's something you can do from Visual Studio ).

No comments:

Post a comment