Skip to content

Instantly share code, notes, and snippets.

@defHLT
Created January 5, 2017 13:48
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save defHLT/ff7517cb563209a62abb03df05333b2c to your computer and use it in GitHub Desktop.
Save defHLT/ff7517cb563209a62abb03df05333b2c to your computer and use it in GitHub Desktop.
Undo a git rebase.
# 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}
@christianbueno1
Copy link

thank pals

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment