0

Say I have a feature branch and was rebasing from a devlopment branch and ran into a merge conflict. Instead of including both the content from the development branch and the content from my feature branch during conflict resolution, I mistakenly chose to keep only the content from the feature branch.

Now when I go to merge the feature into the development branch git will do a fast-forward merge which is desired, however, all the content from the development branch that I did not include in the rebase merge resolution will now be removed from the devlopment branch. This continues to happen even if I do a hard reset of the head of the development branch back before the merge.

How can I reset gits 'recollection' so to speak of the mistaken way that I had resolved the conflict?

koalamo
  • 199
  • 3
  • 11

1 Answers1

-1

Well, this is how git works... Probably the easiest way to handle this, is to find your old commit, then redo the rebase.

When doing a rebase, you make new commits, but your old commits are normaly not deleted. You can find the hash of your old commits using git reflog. Newest items are on top. Just scroll down until you find the head commit of the old branch.

When you have the hash of you old commit, just do a hard reset on this commit.

git reset --hard <your_commit_hash>

Fabian S.
  • 909
  • 6
  • 20