git merge - How to do Git unmerge for certain branches? -


there 5 branches have been merged sequentially master in following order: branch 1, branch 2, branch 3, branch 4, branch 5.

now, found out branch 3 , branch 4 unwanted.

i following:

  1. rollback master before branches have been merged.
  2. merge 1 one, branch 1, branch 2, , branch 5 master.

is there better way achieve using git command such branch 3, , branch 4 have been merged excluded master?

this depends on have done:

  1. did pushed changes alread?
    • you can git reset --hard position before branch 3 , 4 merged , remerge branch 5 again. results in history rewriting might intended spoken not idea.
    • you can revert position branch 3, 4 merged , merge branch 5 again.
  2. did not yet pushed changes?
    • reseting hard still choice don't have drawbacks of history rewriting on remote
    • reverting idea here.

the decision you.


Comments