git throw away local changes one file code example
Example 1: git reset change in one file
# undo local changes to specific file
git checkout -- file
Example 2: git discard unstaged files
git stash save --keep-index --include-untracked
# undo local changes to specific file
git checkout -- file
git stash save --keep-index --include-untracked