code: def checkout(repository, target):
      
      # git fetch <remote> refs/changes/<review_id>
      #git checkout FETCH_HEAD
      repository.git.fetch([next(iter(repository.remotes)), target])
      repository.git.checkout("FETCH_HEAD")
      return repository.git.rev_parse(["--short", "HEAD"]).encode('ascii', 'ignore')
docs: Check out target into the current directory.
      Target can be a branch, review Id, or commit.
  
      :param repository: Current git repository.
      :param target: Review ID, commit, branch.
      :return: Return the most recent commit ID (top of the git log).