Here are a few things for working with commits and previous file versions.
git add -Agit revert [sha]
The above block is 2 sequential git commands. First, add all file changes to Git's watchlist. Roll back to the previous commit, throwing away all changes that you haven't yet committed.
git checkout -b [branch-name] [sha]
Check out an old commit to a new branch so that you can fiddle with it.
git checkout origin/master -- [file]
Replace the current working directory version of that file with the one from master. This is great for reverting a bunch of changes.
git add -Agit stash
These two commands which will allow you to save your work in the middle of a commit, and come back to it later. In detail:
Save all changed, added and deleted files to the index
Save that work into a magic "stash".
Now you can do whatever you need to do next, such as checkout another branch or switch projects. When you're ready to come back to your stashed work: git stash pop
git stash list
List all of the stuff you've previously stashed.
git stash apply --index
Applies your most recently stashed work back to your working index. You must also git stash drop [stash name] to remove that particular stash from the list of stashed stuff. git stash pop as used above just handles all of this for you.
Here are some more handy git commands, which I use frequently.
git checkout -b [new-branch]
Create a new branch, check it out, and move all un-staged changes into that new branch. This is perfect for when you've just started some changes, and then remembered that these changes should really go into their own branch.
git add -A
Add all changed, added and deleted files in path to repo.
git checkout [filename]
Throw away any uncommitted changes to a file by getting a new one from index.
git show [hash]
Details about a commit, including files changed and the actual changes. [hash] should be the actual ID of the commit, which you can get from git log.