code: func (r *StatefulSetRollbacker) Rollback(obj runtime.Object, updatedAnnotations map[string]string, toRevision int64, dryRun bool) (string, error) {
  	if toRevision < 0 {
  		return "", revisionNotFoundErr(toRevision)
  	}
  	accessor, err := meta.Accessor(obj)
  	if err != nil {
  		return "", fmt.Errorf("failed to create accessor for kind %v: %s", obj.GetObjectKind(), err.Error())
  	}
  	sts, history, err := statefulSetHistory(r.c.AppsV1(), accessor.GetNamespace(), accessor.GetName())
  	if err != nil {
  		return "", err
  	}
  	if toRevision == 0 && len(history) <= 1 {
  		return "", fmt.Errorf("no last revision to roll back to")
  	}
  
  	toHistory := findHistory(toRevision, history)
  	if toHistory == nil {
  		return "", revisionNotFoundErr(toRevision)
  	}
  
  	if dryRun {
  		appliedSS, err := applyRevision(sts, toHistory)
  		if err != nil {
  			return "", err
  		}
  		return printPodTemplate(&appliedSS.Spec.Template)
  	}
  
  	// Skip if the revision already matches current StatefulSet
  	done, err := statefulsetMatch(sts, toHistory)
  	if err != nil {
  		return "", err
  	}
  	if done {
  		return fmt.Sprintf("%s (current template already matches revision %d)", rollbackSkipped, toRevision), nil
  	}
  
  	// Restore revision
  	if _, err = r.c.AppsV1().StatefulSets(sts.Namespace).Patch(sts.Name, types.StrategicMergePatchType, toHistory.Data.Raw); err != nil {
  		return "", fmt.Errorf("failed restoring revision %d: %v", toRevision, err)
  	}
  
  	return rollbackSuccess, nil
  }
docs: // toRevision is a non-negative integer, with 0 being reserved to indicate rolling back to previous configuration