1
Reply

How do I discard unstaged changes in Git?

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 -- 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 files
    git stash save --keep-index --include-untracked