Undo git merge master into function

I have two branches: Master and Function.

I made some changes to the Master and wanted to copy them into Feature. So I merged Master into Feature. Apparently it was wrong because now the previous changes to Feature appear in Master.

What I expected:
A - B - - - - E - G   [master]
     \         \
      C - D - - F - H [feature]

What it looks like now:
                      G   [master] 
                     /
A - B - C - D - E - F - H [feature]

      

Here's the fun part: I merged Master into Feature twice before noticing the problem, and I made additional commits for both branches. How do I undo the merge or make the Master not be affected by the Committ functions?

+3


source to share


1 answer


Given the tree you are referring to, you want to undo C, D, and F from master. To do this, on the command line, enter:



git checkout master
git revert C
git revert D
git revert F

      

0


source







All Articles