code: def setVersion(self, version):
          
          try:
              sha = self.versions(version).commit.sha
              self.git.reset("--hard", sha)
          except Exception, e:
              raise RepoError(e)
docs: Checkout a version of the repo.
  
          :param version: Version number.