I'm new Github so please forgive what may seem like an obvious question. I have an Experimentation
branch which is 24 commits ahead of the master
branch.
Following this tutorial, I merged the master
branch with the Experimentation
branch like so:
git checkout master
git merge Experimentation
(There were no merge conflicts.)
But then I realized that merging the two branches would not keep the commit history of the Experimentation
branch and what I really wanted was to do a rebase (in order to keep the commit history of the Experimentation
branch).
So my question is: how do I undo the merge of the master
branch?
I've already tried:
$ git branch
Experimentation
* master
pod-attempt
$ git merge --abort
fatal: There is no merge to abort (MERGE_HEAD missing).
The "fatal" message confused me b/c I thought I did merge the master
branch.
There is no ongoing merge
pending so git is supposed to show you,
fatal: There is no merge to abort (MERGE_HEAD missing).
Now if you want to go back to previous state (state before you merged), try
$ git branch
Experimentation
* master
pod-attempt
$ git reset --hard HEAD~24
You are done!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With