What is the difference between “git checkout — .” and “git reset HEAD --hard”?
问题 This is not a general question about what '--' does, as in the marked duplicate. This is a git-specific question asking for clarity on what the operational differences are between the mentioned commands. If I want to clean out my current directory without stashing or committing, I usually use these commands: git reset HEAD --hard git clean -fd A co-worker also mentioned using this command: git checkout -- . It's a difficult command to google, and it's not clear to me from the git