Skip to content

Instantly share code, notes, and snippets.

@AngelCruzL
Forked from HashNuke/gist:608259
Created September 1, 2023 16:36
Show Gist options
  • Save AngelCruzL/44159e5572acc10967be156b896bbf00 to your computer and use it in GitHub Desktop.
Save AngelCruzL/44159e5572acc10967be156b896bbf00 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^
@AngelCruzL
Copy link
Author

[user]
email = [email protected]
name = Luis Ángel Cruz Lara

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment