Add snippet for retrieving a commit by its SHA

The README links to a snippet for ‘Get[ting] the commit-object from a
name or a SHA-1’. However, in that snippet there was only code for
getting the commit-object from the name. Add the SHA-1 part.