How do I discard changes in my working copy that are not in the index? For all unstaged files in current working directory use: git checkout -- . For a specific file use: git checkout -- path/to/file/to/revert -- here to remove ambiguity (this is known as argument disambiguation). For Git 2.23 onwards, one may want to use the more specific git restore . resp. git restore path/to/file/to/revert t..