Skip to content

Instantly share code, notes, and snippets.

@nickfloyd
Created February 3, 2011 14:48
Show Gist options
  • Save nickfloyd/809559 to your computer and use it in GitHub Desktop.
Save nickfloyd/809559 to your computer and use it in GitHub Desktop.
For all of us boneheads out there that push accidental commits
git push -f origin HEAD\^:master
so commit history in the remote looks like:
Had to clean up some things from the merge
nickfloyd (author)
January 26, 2011
commit 4bcce9878c454ba5583c
tree e6f4cffa47b1301a4cfc
parent ab5f2a7070dcc2af0f59
Did some other stuff because I'm super dangerous like that
nickfloyd (author)
January 26, 2011
commit ab5f2a7070dcc2af0f59
tree 258e345c89f3ce8d3ecb
parent 646ea8de0e94171837ca
After "git push -f origin HEAD\^:master" commit history looks like:
Did some other stuff because I'm super dangerous like that
nickfloyd (author)
January 26, 2011
commit ab5f2a7070dcc2af0f59
tree 258e345c89f3ce8d3ecb
parent 646ea8de0e94171837ca
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment