Uncommited files in git repo: how to reject local changes

It has happened to me a few times: I do local changes and test stuff locally. Then I come back a while later (weeks) and I have forgotten what were the changes for. In order to play it safe, I want to reset my local files to what is there on the github repo, so here is the solution


git fetch --all
git reset --hard origin/master

 Thanks RNA!