xxxxxxxxxx
git reflog # determine pre-rebase head number, N
git reset --hard HEAD@{N}
xxxxxxxxxx
# Step 1: Find the commit SHA before the rebase using git reflog
$ git reflog
# Step 2: Reset the branch to the commit before the rebase
$ git reset --hard <commit-SHA>