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
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
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