Unmerge a git branch, keeping post-merge commits
Say there are two branches
I work on
master, a friend on
Once things are finalized, we merge
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?
One Solution collect form web for “Unmerge a git branch, keeping post-merge commits”
Read through Pro Git – Undoing Merges.
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.
Git SCM – Undoing Merges
Git Ready – Rolling back changes with revert