J4N
J4N

Reputation: 20761

TFS: Checkin mistakenly made before a branch

I was starting a a feature, made a few working changes and then we(management and architect) decided to create a new branch for this feature.

The issue is that I already made some checkin (and other users have some other non-conflicting changes after), and those checkins have to be "removed" of their current branch, then put on the new branch.

Do you see a way to do this without having to make a copy of all the files I modified(120 files, in very different parts of the application), rollback ma changes, then checkout all the modified files in the new branch, and copy files with my modification?

We are using TFS(2010 if I'm not mistaken).

Upvotes: 0

Views: 39

Answers (1)

Jason Williams
Jason Williams

Reputation: 57952

There are two approaches:

1) Branches can be made retrospectively, so the easiest is to ditch the branch you created and simply create a new branch that is taken from the change-set (or date/time, or label) just prior to your unwanted check-in. If you have some later check-ins that you still want to keep in the branch, just merge them into the new branch as normal. (note: branches are very lightweight, as they essentially only hold the differences from the mainline, so the branch you are abandoning will not use up much disk space because it's near-unchanged)

2) Or check out the affected files in the branch, copy over them with the previous version, and then check them in again to "roll back" the unwanted change-set. (This is a much more laborious and error prone approach though - I'd go for option (1) unless there was a good reason not to)

Upvotes: 1

Related Questions