Answers for "remove/undo all modified files git"

0

remove/undo all modified files git

git reset --hard # removes staged and working directory changes

## !! be very careful with these !!
## you may end up deleting what you don't want to
## read comments and manual.
git clean -f -d # remove untracked
git clean -f -x -d # CAUTION: as above but removes ignored files like config.
git clean -fxd :/ # CAUTION: as above, but cleans untracked and ignored files through the entire repo (without :/, the operation affects only the current directory)
Posted by: Guest on August-11-2021

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language