Unmerge a git branch, keeping post-merge commits

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.

  • How can I convert a Mercurial repository to Git…in *Windows*?
  • How can I squash merge when merge.ff = only?
  • Two git repos accidentally merged, how to clean up
  • size of array '__curl_rule_01__' is negative
  • Cannot clone private repo from Vagrant provision file
  • Strange behavior from Git or editor: symbol added in a checkout?
  • 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?

  • GIT Source Control
  • Difference between origin master & origin/master with git pull and git push commands
  • ! No such app as demo_app
  • Why does git push give me “Anonymous access to repo#### denied” error?
  • Git GUI like Bzr Explorer but for Git?
  • Git: switch branches mid-merge
  • One Solution collect form web for “Unmerge a git branch, keeping post-merge commits”

    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:

    1. Git SCM – Undoing Merges

    2. Git Ready – Rolling back changes with revert

    Git Baby is a git and github fan, let's start git clone.