Use commit when resetting git sources

The git reset command accepts only commits, not references, so parse the
reference before checking out the branch.  (Thanks bundler sources for
making this easier to figure out!)

Fixes #931

Fixes #822