git discard local changes
# Discarding local changes (permanently) to a file: git checkout -- <file> # Discard all local changes to all files permanently: git reset --hard
Source: docs.gitlab.com
how to remove file changes in git
git clean -df git checkout -- .
Source: stackoverflow.com
git discard all changes command
git reset –hard # Revert uncommitted changes in index git clean -fxd # Remove newly created files that not in index
git reset one file
git checkout HEAD -- my-file.txt
git discard all local changes
git restore .
discard all changes git
git clean -df git checkout -- .
Source: stackoverflow.com