Roll back to a previous version after a bad deploy

versions & rollback

// what it does

With no version ID, `rollback` reverts to the previous deployment — the fastest way out of an incident. Pass an explicit version ID (from `versions list`) to jump to a specific known-good build. `-m` records the reason on the deployment.

// shell

$ wrangler rollback --message "revert bad deploy"
$ wrangler rollback <version-id> -m "pin to known-good"

// gotcha

Rollback only swaps the version pointer — it does NOT restore old secrets, KV/D1/R2 data, or a migrated database schema, so rolling back after a breaking migration can still leave you broken. It also prompts for confirmation unless you pass `-y`.