Rajanikant Hawaldar
How do I discard unstaged changes in Git?

How do I discard unstaged changes in Git?

By Rajanikant Hawaldar in Tools on Oct 10 2020
  • Bohdan Stupak
    Apr, 2021 23

    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

    • 1


Most Popular Job Functions


MOST LIKED QUESTIONS