Rolling back changes in TFS

Although you cannot get rid of changesets in TFS, you can easily roll back a change if something was mistakenly checked-in.  This functionality used to be part of Team Foundation Power Tools, but it is now part of the regular TFS functionality, in command-line:

tf rollback /changeset:1234

There’s a bunch of parameters that you can specify, such as version to rollback to, date, workspace, etc.  Just do tf rollback /? to see all the options.

After you run the command, you will still need to check-in your changes, and you will now see a “rollback” entry in history, so like I said, you really are not getting rid of your bad check-in, just getting things back to were they were before.

About esteban

Esteban is the Founder and Chief Technologist at Nebbia Technology, an ALM consulting and Azure-powered technology company. He is a software developer with a passion for ALM, TFS, Azure, and software development best practices. Esteban is a Microsoft Visual Studio ALM MVP and ALM Ranger, Pluralsight author, and the president of ONETUG (Orlando .NET User Group).

Leave a Reply

Your email address will not be published. Required fields are marked *

Are you human? *