0

the history will be like this:

A<───┬─ BadMerg <── C  <── D
B<───┘

Now I realized the conflict resolution in the merge was bad. I want to redo the merge again, but to keep the commit C and D. How can I do this?

Wang
  • 7,250
  • 4
  • 35
  • 66

1 Answers1

3

The easiest end riskless way that comes to my mind is:

1 - create a new branch named "backup" on commit D but DO NOT checkout to that branch. Stay on your current one.

2 - hard reset your current branch to either commit A or B (pick A if you want to merge B into A)

3 - merge B

4 - cherry pick C and D

5 - if everything is good, delete your backup branch.

vratojr
  • 818
  • 2
  • 8
  • 25