DEV Community

Discussion on: Turn around your Git mistakes in 17 ways

Collapse
 
jessekphillips profile image
Jesse Phillips

I have some added suggestions to complement what you have.

Use git switch instead of git checkout.

Rather than just dropping changes with a reset, switch into a new branch, commit, then switch out. This ensures if nothing else you'll have a reflog for a bit.

$ git commit --fixup

Or search a commit message instead of hash

$ git commit --fixup :/msg

Some comments have been hidden by the post's author - find out more