code: public Ref checkoutTag(Git git, String tag) {
          try {
              return git.checkout()
                  .setName("tags/" + tag).call();
          } catch (GitAPIException e) {
              throw new IllegalStateException(e);
          }
      }
docs: Checkout existing tag.
  
  @param git
  instance.
  @param tag
  to move
  
  @return Ref to current branch