Skip to content

Instantly share code, notes, and snippets.

@lolptdr
Forked from rymawby/undo-git-rebase.sh
Created June 3, 2016 16:27
Show Gist options
  • Save lolptdr/059340c84e88b270b1f94f6f70042b8d to your computer and use it in GitHub Desktop.
Save lolptdr/059340c84e88b270b1f94f6f70042b8d to your computer and use it in GitHub Desktop.
Undoing a git rebase
# find head commit
git reflog
# now reset hard - where N is the head commit found in the reflog
git reset --hard HEAD@{N}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment