code: public void checkout(Ref ref) throws IOException, JavaGitException {
      GitCheckout gitCheckout = new GitCheckout();
      gitCheckout.checkout(path, null, ref);
  
      /*
       * TODO (rs2705): Figure out why this function is setting this.path. When does the WorkingTree
       * path change?
       */
      // this.path = branch.getBranchRoot().getPath();
    }
docs: Switches to a new branch
  
  @param ref
  Git branch/sha1 to switch to