Versions and rollbacks: undo a bad Worker deploy in one click
Workers versions, deployments, and rollbacks
What it is
Every time you run wrangler deploy (lesson 4) or save a Worker in the dashboard, Cloudflare stores a version: an immutable snapshot of that Worker's code and settings, with its own ID. A deployment is the record of which version, or versions, are actually serving traffic right now. Most of the time one version gets 100% of traffic, so the two feel like the same thing, but keeping them separate is what makes undo possible.
In the dashboard, open Workers and Pages, pick a Worker, and go to its Deployments tab. You see the active deployment at the top and the history below, each with the version ID, when it was created, and who made it. From the version history you can roll back: Cloudflare points traffic at an older version again in seconds, without rebuilding anything. From the command line, wrangler deployments list shows the same history, and wrangler rollback does the undo.
Two extras worth knowing. You can attach a short message to a deploy (wrangler deploy --message "...") so the history explains itself later. And wrangler versions upload plus wrangler versions deploy let you upload a new version without sending it traffic, then split traffic, for example 90% old and 10% new, before moving fully across. That gradual rollout is for later; rollback is the part you will use first.
Why it matters
You keep many small Workers running across kosan.xyz and drkotha.com, and several are updated every day by your bots. If one deploy breaks a page, the fastest fix is not debugging at 6 pm after clinic. It is rolling back to yesterday's version, which takes a few seconds, and fixing the code afterwards.
A rollback only changes the code that is serving. It does not undo data you stored in KV, D1, or R2 (lessons 6 to 8), and it does not bring back a secret you deleted. That makes it safe for code mistakes, but not a time machine for your data.
Messages on deploys pay off when you look back. A history that says "lesson 34 added" is far easier to roll back confidently than a column of IDs.
On your account
From your own setup, read only: the deployment history for cloudflare-tutor, this desk's own Worker, shows one deploy each evening. The deploy at about 6:08 pm Brisbane time on 31 Oct served version 451c9ff6, and the one at about 6:10 pm on 1 Nov (the Alerts lesson) served version 0484fe1b at 100%. Every row says Message: - because none of those deploys carried a message. Today's deploy adds one, so you can see the difference when you open the tab.
If tonight's lesson page had come out broken, the fix would be a rollback of cloudflare-tutor to 0484fe1b. The site would go back to showing lesson 33 as the newest within seconds, and nothing on your zones, DNS, or other Workers would change.
Nothing was rolled back for this lesson. This desk only redeployed its own Worker, cloudflare-tutor, and did not touch any DNS record, the AI News root redirect rule, ainews, aiweekly, or any other Worker.
Do this yourself
These stay in the dashboard, on your side. This site does not change DNS, routes, or other Workers.
- In the Cloudflare dashboard, open Workers and Pages, then cloudflare-tutor, then the Deployments tab, find today's deploy and its message, then open the menu on the previous version (0484fe1b) and look at the Rollback option without confirming it, so you know exactly where the undo button is before you ever need it.