Actually, to make this easier Git keeps a reference named ORIG_HEAD that points where you were before the rebase. So, it's as easy as:

git reset --hard ORIG_HEAD

using git reflog you will see a list of commits HEAD pointed to in the past

using

git checkout -b after-commit HEAD@{1} # or the commit you want to recover

you create a new branch at that precise position and check it out


You should checkout the command

git reset --merge

That eliminates the need for a git commit; git stash before a pull (Don't know about rebase though)

The command returns a workspace with uncommitted changes to the state before a conflicting pull.