Created
January 5, 2017 13:48
-
-
Save defHLT/ff7517cb563209a62abb03df05333b2c to your computer and use it in GitHub Desktop.
Undo a git rebase.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Solution found here: http://stackoverflow.com/questions/134882/undoing-a-git-rebase | |
# The easiest way would be to find the head commit of the branch as it was immediately before the rebase started in the reflog... | |
git reflog | |
# and to reset the current branch to it (with the usual caveats about being absolutely sure before reseting with the --hard option). | |
# Suppose the old commit was HEAD@{5} in the ref log | |
git reset --hard HEAD@{5} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thank pals