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.

  • Push with Git Bash works, but fails with Git Gui
  • Xcode + GitHub. What is the proper setup
  • issue with forking an unstable repo on Github
  • Delete a merge commit from git
  • Git push fails with “fatal: early EOF” when PUSHing but only on one file
  • Git: name and email address configuration
  • 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?

  • How to merge a successful build of a pull request using a Jenkinsfile
  • Ignoring all filetypes underneath a directory .gitignore
  • Git push existing repo to a new and different remote repo server?
  • Can I retroactively create a tag that is based on a date?
  • Minify CSS files via git hook
  • What does “~ (END)” mean when displayed in a terminal?
  • 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.