Rolling Back Worker Deployments

Cloudflare introduced deployments for Workers in November 2022, giving developers a way to track changes to their Workers over time—including who made changes and where they came from. Today, that foundation is extended with a rollback feature that lets you quickly redeploy a past version when something goes wrong. It adds a recovery path for when a deployment isn't as perfect as intended.

Rolling Back from the Dashboard

In the Cloudflare dashboard, the Deployments tab now shows a new icon on the far right for every deployment that isn't the most recent one. Hovering over this icon reveals the option to rollback to that specific deployment.

Clicking the icon opens a confirmation dialog where you enter a reason for the rollback. This reason becomes part of your deployment history, providing context for why the rollback was necessary.

After you confirm, a new rollback deployment is created. It receives its own unique deployment ID but is an exact duplicate of the deployment you rolled back to. The dashboard shows the new deployment ID along with the rollback message you entered, and annotations label the deployment clearly as a rollback.

Rolling Back with Wrangler

Wrangler version 2.13 adds a wrangler rollback command. Run without arguments, it rolls back to the previous deployment—handy when you know the last version is the one you want. Pass a deployment ID to target a specific past deployment. As with the dashboard, you'll be prompted to enter a rollback reason and confirm the action.

The wrangler deployments command has also been refactored. Use wrangler deployments list to view the last 10 deployments, with annotations for rollback from and message that match the dashboard's display. For more detail on a specific deployment, run wrangler deployments view [ID]. The view command has been expanded to show additional data such as compatibility date, usage model, and bindings, so you can understand a deployment's configuration without digging through source files.

Availability

Dashboard users get rollbacks immediately. Wrangler users need to upgrade to version 2.13 to use the new functionality. For full details, including known limitations, consult the updated deployments documentation.