Issue #29 work.

Removed unnecessary `git reset --hard HEAD` equivalent. Tidied up error
handling.