discard files in git code example
Example 1: git discard unstaged files
git stash save --keep-index --include-untracked
Example 2: revert unstaged changes git
git checkout -- path/to/file/to/revert
git stash save --keep-index --include-untracked
git checkout -- path/to/file/to/revert