Skip to content

Instantly share code, notes, and snippets.

@p0rsche
Forked from HashNuke/gist:608259
Last active August 29, 2015 14:00
Show Gist options
  • Save p0rsche/11164926 to your computer and use it in GitHub Desktop.
Save p0rsche/11164926 to your computer and use it in GitHub Desktop.
Undoing git push
# 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^
# removing remote branch
git push origin --delete <branch>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment