Post

Undo a git rebase.

The easiest way would be to find the head commit of the branch as it was immediately before the rebase started using reflog.

1
$ git reflog

Then reset the current branch to the old commit. Suppose the commit was HEAD@{10} in the ref log.

1
$ git reset --hard HEAD@{10}

In windows, you may need to quote the reference:

1
$ git reset --hard "HEAD@{10}"
This post is licensed under CC BY 4.0 by the author.