If you want to be able to return to the precise version of the repository at the time you do a build it is best to tag the commit from which you make the build.
The other answers provide techniques to return the repository to the most recent commit in a branch as of a certain time-- but they might not always suffice. For example, if you build from a branch, and later delete the branch, or build from a branch that is later rebased, the commit you built from can become "unreachable" in git from any current branch. Unreachable objects in git may eventually be removed when the repository is compacted.
Putting a tag on the commit means it never becomes unreachable, no matter what you do with branches afterwards (barring removing the tag).