code: func NewCmdRolloutUndo(f cmdutil.Factory, streams genericclioptions.IOStreams) *cobra.Command {
  	o := NewRolloutUndoOptions(streams)
  
  	validArgs := []string{"deployment", "daemonset", "statefulset"}
  
  	cmd := &cobra.Command{
  		Use:                   "undo (TYPE NAME | TYPE/NAME) [flags]",
  		DisableFlagsInUseLine: true,
  		Short:                 i18n.T("Undo a previous rollout"),
  		Long:                  undoLong,
  		Example:               undoExample,
  		Run: func(cmd *cobra.Command, args []string) {
  			cmdutil.CheckErr(o.Complete(f, cmd, args))
  			cmdutil.CheckErr(o.Validate())
  			cmdutil.CheckErr(o.RunUndo())
  		},
  		ValidArgs: validArgs,
  	}
  
  	cmd.Flags().Int64Var(&o.ToRevision, "to-revision", o.ToRevision, "The revision to rollback to. Default to 0 (last revision).")
  	usage := "identifying the resource to get from a server."
  	cmdutil.AddFilenameOptionFlags(cmd, &o.FilenameOptions, usage)
  	cmdutil.AddDryRunFlag(cmd)
  	o.PrintFlags.AddFlags(cmd)
  	return cmd
  }
docs: // NewCmdRolloutUndo returns a Command instance for the 'rollout undo' sub command