Skip to content

Instantly share code, notes, and snippets.

@arturmpinho
arturmpinho / gist:23e065733992e0a7d05f28cd5cecd876
Created June 17, 2021 15:54 — forked from HashNuke/gist:608259
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^