Created
April 2, 2022 16:04
-
-
Save mritzco/17a9690d3583d17bb1a135afef50c22b to your computer and use it in GitHub Desktop.
Undo the last local commit, fix and re-commit
This file contains 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
git commit -m "Something terribly misguided" # (0: Your Accident) | |
git reset HEAD~ # (1) | |
#[ edit files as necessary ] # (2) | |
git add . # (3) | |
git commit -c ORIG_HEAD # (4) | |
#Ref: https://stackoverflow.com/questions/927358/how-do-i-undo-the-most-recent-local-commits-in-git |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment