How can I get rid of all the changes in all the files of my repository?
Say I am in a branch and I did some changes. git status
returns
Other way which I found useful is:
git checkout <wildcard>
Example:
git checkout *.html
More generally:
git checkout <branch> <filename/wildcard>
If you are at the root of your working directory, you can do git checkout -- .
to check-out all files in the current HEAD and replace your local files.
You can also do git reset --hard
to reset your working directory and replace all changes (including the index).