Is there a git command to revert all uncommitted changes in a working tree and index and to also remove newly created files and folders?
You can run these two commands:
# Revert changes to modified files. git reset --hard # Remove all untracked files and directories. # '-f' is force, '-d' is remove directories. git clean -fd
2.1m questions
2.1m answers
60 comments
57.0k users