How do I just checkout a branch into an existing folder in a pristine state?
I am working in Windows 10. switched to a new branch of my project, and noticed that some existing (untracked) folders from the other branch were still hanging around. I tried to use:
git clean -fdx
to remove these folders and their files. I got errors such as:
warning: failed to remove Source/Web/node_modules/gulp-sass/node_modules/gulp-ut
il/node_modules/dateformat/node_modules/meow/node_modules/read-pkg-up/node_modul
es/read-pkg/node_modules/load-json-file/node_modules/parse-json/node_modules/err
or-ex
I then tried to use
git reset --hard HEAD
which succeeds, but the folders/files are still there. So how do I just checkout my branch to a pristine state?
The more I use git, the more it just seems designed to actually prevent you from getting work done.