-
-
Save shperblim123/19833bd0fc2544b8a283bf1e85d63d88 to your computer and use it in GitHub Desktop.
to undo push and commits
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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