Skip to content

Instantly share code, notes, and snippets.

@algo31031
Forked from HashNuke/gist:608259
Last active August 29, 2015 14:01
Show Gist options
  • Save algo31031/61ab8afd37e51d4fd0d2 to your computer and use it in GitHub Desktop.
Save algo31031/61ab8afd37e51d4fd0d2 to your computer and use it in GitHub Desktop.
to undo push and commits
# to undo a git push
git push -f origin HEAD^:master
# to get to previous commit (preserves working tree)
git reset --soft HEAD
# to get back to previous commit (you'll lose working tree)
git reset --hard HEAD^
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment