Fixes Issue #68 flip logic and getCommitFromRef