@b0rk perhaps more useful: when using git I prefer to avoid using subcommands that do “to much”. I never use “git pull”. I don’t admit the existing of “git add -a” and avoid “git add <dir>” without -p. It try to check “git status” and “git diff --staged”.
I’ve also learned to recover using “git reflog” and “git reset --hard” when I do manage to blow things up. (Though the latter misapplied is the main way I’ve lost work by accident.)