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?
A safe and long way:
git branch todeletegit checkout todeletegit add .git commit -m "I did a bad thing, sorry"git checkout developgit branch -D todeletegit clean -fd
didn't help, new files remained. What I did is totally deleting all the working tree and then
git reset --hard
See "How do I clear my local working directory in git?" for advice to add the -x option to clean:
git clean -fdx
Note -x flag will remove all files ignored by Git so be careful (see discussion in the answer I refer to).