Rewind
Rewind takes your app back to a moment: the code that was live, the env vars and settings it ran with, and the data it used, together. You choose which parts come back, look at a preview of the result on its own URL, and only then make it live. The original databases and caches are never overwritten, so an applied rewind can be undone.
Rewind from the dashboard
Open the app and go to the Rewind tab.
- Pick a moment. Drag the slider, use a shortcut (10 minutes ago, an hour ago, yesterday) or type an exact time in your own time zone. The strip above the slider marks your deploys, your database's restore window and your snapshots.
- Pick the parts. Every part of the app has a switch: the code, the env vars and settings, each database, each cache, and the files on its volume. Next to each one you see exactly what it would come back as. Anything you switch off stays as it is now.
- Preview this rewind. velixir builds a copy of your app as it was, with its own copies of the data, on its own
velixir.runaddress. This takes a few minutes, mostly while a database replays its history to the exact second. Nothing changes on the live app. - Apply to the live app, from the preview's row under Previews and copies, once you've checked it. The confirmation sums up what changes: the release now and then, which data comes back to when, and what is set aside.
Every deploy on the app's Overview, and a failed deploy's message, has a Rewind to before this link that opens the tab with the moment one second before that deploy started.
A preview runs and bills like any app. One you don't apply is discarded automatically 72 hours after it's ready; the row shows when. Leave the tab open and it tells you when a preview is ready, and Notify me when it's ready adds a browser notification.
If you rewind a database but keep today's code, the plan warns you: your current code will run against the data as it was then, and if a migration ran since, the two may not match.
How exact each part is
| Part | Comes back as |
|---|---|
| Code | The release that was live at that moment |
| Env vars and settings | The env vars, ports, health check and bindings that release was deployed with |
| Postgres databases | Exactly that second, within your plan's backup window |
| Valkey caches | The newest snapshot taken before that moment |
| Files on a volume | The newest snapshot taken before that moment |
A cache on a plan without snapshots starts empty, which most apps cope with, since a cache is rebuilt as it's used. A volume with no snapshot from before that moment can't be rewound; switch files off to rewind everything else.
Plan, size and replica counts aren't rewound: they're capacity, not state, and putting them back in the middle of a traffic spike would make things worse.
How far back
- Code and config: 28 days. Releases deployed in that time are kept so they can always run again.
- Databases: as far as the database plan keeps backups: 7 days on Starter, 14 on Standard, 28 on Pro and Scale. The earliest point is shown on the database's page and on the Rewind strip.
- Caches: as far as their snapshots go. Snapshots are taken every 6 hours, kept for a day, then one a day for the plan's retention. The Starter cache plan has no snapshots.
- Files: as far as the volume's snapshots go (daily or weekly, kept 7 to 90 days). See Volumes.
What applying does
- Workers and cron jobs pause, so nothing keeps writing to the data being left behind. The deploy below starts them again.
- The app is pointed at the preview's copies of the databases and caches in the rewind. The originals keep running, untouched, with everything written to them since that moment still in them.
- The files on the volume are snapshotted as they are now, then restored from the snapshot in place (a volume can't be swapped like a database).
- The release and config from then are deployed. Deploys of the app are refused while this runs.
- The preview's own app is deleted. Its database and cache copies now belong to your app, with the same high availability and external access settings as the originals.
The preview's copies become your live data as they are, so anything written to the preview while you were checking it (a test sign-up, say) is live too.
A copy is a new instance, so a database or cache with external access gets a new external host and port. Tools outside velixir that connect directly, like psql or a BI tool, keep reaching the original until you point them at the new address. The confirmation lists any address that changes, and the Rewind tab and the audit log show it after applying.
Data set aside
Data written to the live app after that moment is set aside on the originals, not deleted. If you need some of it, it's there to copy across. The Rewind tab lists what was set aside and until when.
The originals keep running, and billing, for 7 days, so the rewind can be undone. After that they're deleted the normal way: a database keeps its backups for its plan's retention and can be restored from Recently deleted. Delete now on the Rewind tab does it straight away. Once they're deleted the rewind can't be undone.
An original another app is also connected to is never deleted this way.
Undo
Undo on an applied rewind puts the app back on its original databases and caches, deploys the release and config it had just before, and restores the files snapshot taken when you applied. Workers and cron jobs pause while it moves, like when applying. The copies the rewind made stay until you Discard it.
If applying stops part of the way through (a deploy that doesn't come up healthy, say), the rewind shows as failed with "The apply didn't finish". The app may be partly on the copies, so it can't be discarded; Undo puts it back as it was.
Only one rewind can be applied to an app at a time. Once the data a rewind set aside is deleted, it no longer counts, and you can apply another.
Rewinding again after a rewind
After a rewind is applied, your app's databases are the rewind's copies. While the originals are set aside, Rewind still reaches back before the apply: moments before it come from the original. Between the apply and the copy's first backup (usually a few minutes) there's nothing to restore from, and the strip shows that stretch as out of reach. Once the originals are deleted, the earliest moment is the copy's first backup.
What Rewind can't do
Rewind restores your app, not the outside world. An email already sent, a payment already taken or a webhook another service received stays that way.
If the database itself was deleted, rather than the data in it, Rewind can't reach it from the app any more, but it isn't gone: a deleted database keeps its backups for the plan's retention window and can be restored from Recently deleted on the Databases page. See Restoring a deleted database.
Rolling back code only
For a quick rollback of just the code, use Rollback on the Deploys tab: it redeploys an earlier release without a rebuild and keeps your current env vars. + config next to it also brings back the env vars and settings that release last ran with.
From the CLI
velixir rewind plan --at "2h ago" # what each part would come back as
velixir rewind --at "2h ago" --no-databases # preview: code, config, caches and files
velixir rewind apply <rewind-id> # asks first; --yes in scripts
velixir rewind undo <rewind-id> # also repairs an apply that didn't finish
velixir rewind discard <rewind-id> # a preview you won't apply
velixir rewind set-aside <rewind-id> # what an applied rewind set aside, and until when
velixir rewind set-aside delete <rewind-id> # delete it now; no undo after this
velixir rewind list
--at takes 30m ago, 2h ago, 1d ago, now, a time in your local zone like 2026-10-16 09:41, or UTC like 2026-10-16T08:41:00Z. Leave parts out with --no-code, --no-config, --no-databases, --no-caches, --no-files, or --exclude <id> for one database or cache.
From the API or an agent
GET /api/v1/apps/{id}/timeline: deploys, config changes and restore points.GET /api/v1/apps/{id}/rewind/plan?at=...: what a rewind would restore (addcode=false,databases=false,exclude=<id>and so on).POST /api/v1/apps/{id}/rewindwith{ "at": "...", "databases": true, ... }: start a preview.POST /api/v1/forks/{id}/applyand/undo,GET /api/v1/forks/{id}for progress,DELETE /api/v1/forks/{id}to discard.DELETE /api/v1/forks/{id}/set-aside: delete what an applied rewind set aside, now.GET /api/v1/forks/{id}shows it (setAside,setAsideUntil) and any changed external address (notes).
In the MCP server, the same steps are rewind_plan, rewind, fork_status, rewind_apply, rewind_undo and rewind_delete_set_aside. The tools tell an agent to ask you before applying or deleting, and with an agent key, applying, undoing, discarding and deleting what was set aside all wait for your approval.
Outgoing webhooks can tell you when a preview is ready (rewind.ready), when one fails (rewind.failed), and when a rewind is applied (rewind.applied) or undone (rewind.undone).
Plans
A preview is an app on the same plan as yours. The Free plan includes one app, so move a Free app to a paid plan before rewinding it.
An app an agent deployed without an account has to be claimed before it can be rewound or copied.