First the basics of remote branches. Your repository looks something like this.
A - B - C [origin/master]
\
D - E [master]
master and origin/master are both branches, which are just labels that point at a commit. In this case, you've made two commits to master since the last time you fetched.
Git doesn't talk to the network unless you tell it to. It keeps track of the last time it looked at a remote repository with a "remote branch". origin/master is a "remote branch". It is your local copy of the master branch on the remote named origin updated the last time git fetch origin or git fetch --all was run (or git pull, which does a fetch).
git reset --hard origin/master
This is used to throw out all your local work. This will reset the current branch and working directory to where origin/master is, which is C. D and E will be lost.
A - B - C [origin/master]
\
D - E [master]
git reset --hard origin/master
A - B - C [origin/master]
[master]
git reset --hard master
This will reset your current branch and working directory back to master. If you happen to be on master this will undo your uncommitted work. But if you're on a different branch, you just blew away your branch.
To throw out your uncommitted changes, the safer thing to do is git reset --hard HEAD. HEAD is a pointer to the currently checked out commit. It will work no matter what branch you're on. I have it aliased to clear.
I want to fetch everything at one point in time, and then work from the local content for the duration of the build so there isn't a chance of changes being made part-way through a build.
Git does not talk to the network unless you tell it to. There's two commands which will update your local repository, git fetch and git pull (which does a fetch). If you don't run those, your origin/ remote branches will not change.
If you fetch and checkout at the start of your build, you'll be fine. If you need to reset to a clean state you can run git reset --hard HEAD. You might also want to run git clean -dxf which will throw out any untracked or ignored files like build artifacts.