Skip to content

Instantly share code, notes, and snippets.

@lovellfelix
Forked from rymawby/undo-git-rebase.sh
Created April 27, 2016 13:01
Show Gist options
  • Save lovellfelix/d8f7742609364361daec56963e74ce61 to your computer and use it in GitHub Desktop.
Save lovellfelix/d8f7742609364361daec56963e74ce61 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