TFS rollback a previous changeset that has has files changed by latter changesets

124 views Asked by At

Lets say Developer A changed a method in file class.cs, tested the changes and checked in. Change-set was merge into acceptance branch and deployed into acceptance environment but the change has not been approved yet by the user to go to production.

Later, Developer B had another change to make on same file for another purpose. This change has high priority and already has been deployed to acceptance and approved by the user BUT the previous change cannot go to production as it has not been approved yet.

Whats the approach here? Rollback the changes of Dev A change-set and then Dev B should redo his work? Somehow merge the two version of the file removing the unwanted change and making a new check-in? (if it's even possible)

1

There are 1 answers

0
Daniel Mann On

This is a great use case for feature toggles. Basically, you make each new piece of functionality toggleable on/off via a flag (this can be driven from the application's database, via a configuration file, or however you'd like to control it). This allows you to keep your code fully integrated and continue shipping even if a given feature is not approved or completed.

The important thing is that you clean up your feature toggles once you're sure that you won't need to disable the new feature again, otherwise the code becomes a big mess of toggles.

Another possibility is to maintain a branching strategy that better supports hotfixes. There is plenty of documentation on various branching strategies for supporting servicing/hotfix releases.

Something like this may be all you need: release branching strategy Ref: https://www.visualstudio.com/en-us/articles/branching-strategies-with-tfvc