Assuming you did not git add
the file to the index, or git commit
the file, then:
git checkout filename
Assuming you already executed a git add
of the file to the index, but did not git commit
it, then:
git reset HEAD filename
git checkout filename
Assuming you did have already executed a git commit
of the file, then:
git checkout origin/master filename
Assuming you want to blow away all commits from your branch (VERY DESTRUCTIVE):
git reset --hard origin/master
git init
git commit -S -m “root” --allow-empty
git remote add origin <repo>
git push origin master