If you have the gitlens extension, you can use the command pallette (Ctrl/Cmd + Shift + p) and search for 'Search commits'. This should show an input for you to search for commits by message, hash, etc.
Open command palette
Search by commit(gitlens)