Throw error when head is not a branch (ex: git checkout <commit sha>)