I cloned a git repo and then started playing around in its master branch. After a while, I want to ignore the changes I just made (without committing them), and switch to a diff
You can discard changes you made in a specific file:
git checkout somefile.txt
And then jump smoothly to the branch:
git checkout gh-pages