Sometimes, in your git repository, you realise everything you did is wrong and you need to start over. Then, this is what you need to do!
Reset the content:
git reset --hard HEAD
Clean the content of the repository:
git clean -f
And one command which will clean everything, including the ignored files or folders (e.g. node_modules):
git clean -xdf
Sources:
- https://draghici.net/2014/10/01/github-force-pull/
- https://stackoverflow.com/questions/9529078/how-do-i-use-git-reset-hard-head-to-revert-to-a-previous-commit