Reputation: 6468
Say there are two branches master
and branchA
.
I work on master
, a friend on branchA
.
Once things are finalized, we merge branchA
with master
.
After several commits on the merged master
, the client wants the
work done on branchA
removed, but NOT the commits done after the merge.
How can we do it?
Upvotes: 40
Views: 31736
Reputation: 15359
Read through Pro Git - Undoing Merges.
Basically, you git revert
the merge commit:
git revert -m 1 hash_of_merge_commit
You may end up with some conflicts that you'll have to manually unmerge, just like when merging normally.
Additional links:
Upvotes: 78