Git - how to revert uncommitted changes including 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
1. good idea to run 'git clean -nd' to preview the changes before running git clean to ensure you dont have untracked files or directories that you care about that will be removed.
2. Save someone a trip to the docs: -f is force, -d is remove directories, -n is dry run (also --dry-run; show output without doing anything yet)