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
Add #884 to History
Reduce indentation in CertCommand#build_key
Ensure private key is not copied

See #807