Skip to main content
ubx rollback computes the diff between the current deployed state and a target snapshot, then prompts to confirm and apply the rollback. The target can be a date or a git SHA prefix.

Usage

ubx rollback <date-or-sha> [flags]

Flags

FlagDescription
--dry-runShow the diff and exit without prompting or applying

Arguments

ArgumentDescription
<date>Date in YYYY-MM-DD format
<sha>Git SHA prefix (at least 6 characters)

Examples

ubx rollback 2026-06-15            # roll back to state on that date
ubx rollback abc1234               # roll back to state at git SHA
ubx rollback --dry-run 2026-06-15  # preview without applying

What happens

  1. Loads the apply history from ubx-history.json (or legacy SQLite)
  2. Finds the snapshot matching the date or SHA
  3. Computes the diff between that snapshot and the current state
  4. Displays the diff
  5. Prompts Apply rollback to "<target>"? [y/N] unless --dry-run

Dry-run output

  Rollback to 2026-06-15

  Resources that would change:
  - aws_s3_bucket.assets-bucket  (remove)
  + aws_vpc.old-vpc               (recreate at old config)
  ~ aws_rds_instance.database     (change instance_class: m5.large → t3.micro)

Rollback note

After confirming, ubx records the rollback intent but does not automatically apply it. The next step is:
  1. Revert the relevant .xcl files to match the target state
  2. Run ubx ship to apply the changes
ubx currently records the rollback plan as a guide — full automated state rollback (without re-running codegen) is planned for a future release.

Exit codes

CodeMeaning
0Rollback plan displayed (or applied)
1No history found, or user cancelled