How to bring my branches to their original state they were in before merging?
To go back to your previous state, you can do:
git checkout release
git reset --hard release@{2.hours.ago}
That puts the branch at a state where it was two hours ago. Choose a reasonable time span that points between when you did the last commit on the branch and when you did the pull --rebase
.
You can also investigate the reflog and choose the commit that is before the git pull --rebase
was completed:
git reflog show release
git reset --hard release@{2} # for example
Verify that you are at the right commit:
git log --pretty=fuller # observe the commit date; should be before you did the pull --rebase
Then push out the corrected branch.
To bring back your release branch to the previous state, use the following command
git revert -m 2 <merge_id>
git push origin <release-branch>