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
git remove all local changes
git reset; git checkout .; git reset --hard HEAD; git clean -fdx; \ git fetch --all; git pull
Source: stackoverflow.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
undo unstaged changes git
git checkout -- .
Source: stackoverflow.com
git remove all changes
For all tracked unstaged files use: git checkout -- . The . at the end is important.