version control - How do I undo the most recent local commits in Git? - Stack Overflow

PHOTO EMBED

Sun Dec 24 2023 16:45:29 GMT+0000 (Coordinated Universal Time)

Saved by @hirsch #bash

$ 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)
content_copyCOPY

https://stackoverflow.com/questions/927358/how-do-i-undo-the-most-recent-local-commits-in-git