How do I discard unstaged changes in Git?
For all unstaged files in current working directory use:
git checkout -- .For a specific file use:
git checkout -- .
git checkout -- path/to/file/to/revert-- here to remove argument disambiguation.In case you don’t want to lose the progress you might want to stash filesgit stash save --keep-index --include-untracked
git checkout -- path/to/file/to/revert
--
git stash save --keep-index --include-untracked