There are lots of ways to target a git commit, e.g.
git show HEAD~1
One way that I often forget to use (but really like it when I remember) is targeting a specific git commit by the commit message, e.g.
git show :/Fix
will target the most recent commit with a message that includes the string “Fix”.
If you want to include a space, use quotes, e.g.
git show :/"Fix silly"
The string matching is actually done using regular expressions, so you can do something like
git show :/^Fix
to target the most recent commit that begins with “Fix”
Leave a Reply