I had a local branch that was older, so I wanted to update it with changes from the remote master while keeping the local changes I had made to it.
So I did this:
git checkout master
git pull master
git checkout my_local_branch
git merge master
This ruined my local branch and made it basically just a clone of master.
Luckily(I think?) I never committed it or pushed it to origin.
So I want to undo the merge.
But I tried , git merge --abort
and it tells me:
fatal: There is no merge to abort (MERGE_HEAD missing).
Also the history is all different because basically it looks just like master.
Is there a way to fix my local branch so that it reverts back to what it looked like before I merged it with master?
Here is what git reflog shows:
51f03ce5 (HEAD -> my_local_branch, origin/master, origin/HEAD, master) HEAD@{0}: merge master: Fast-forward
4b2e85a3 HEAD@{1}: checkout: moving from master to my_local_branch
51f03ce5 (HEAD -> my_local_branch, origin/master, origin/HEAD, master) HEAD@{2}: pull: Fast-forward
949c9d1f HEAD@{3}: checkout: moving from my_local_branch to master
Thanks!