Yet another try. Changes since last time: Added a comment on why doing git reset two times Send output from git checkout to /dev/null Do not know what I should do about git status --short in test cases. --short is only available for newer versions of git.