Skip to main content
You can roll back, and it takes as long as a deploy. Antideploy puts back the last version that went live before the one serving now, by building it again from its source. It is a rebuild, not an instant switch, so it takes as long as your normal deploys do: minutes, not seconds. It is checked and counted like any other deploy. Worth knowing before the moment you need it.

How to roll back

The Deployments tab lists every deploy with its status and, for deploys from GitHub, the commit it built. Choose Roll back next to an earlier version that went live to return to it, or use the Roll back button on the app’s page to return to the last version before the current one. Your coding agent can do the same with POST /api/v1/rollback, which takes the application and, optionally, the deployment to return to. A deploy that is already running has to finish first.

Or put the code back yourself

Rolling back builds an old version again. You can also put the old code back and deploy it like any other change.
Revert the commit that broke things and push:
With deploy on push turned on, the push is the deploy. git revert adds a new commit that undoes the old one, which is safer than rewriting history on a branch other people use.

What a failed deploy leaves running

This depends on where the deploy stopped, and it is the part most worth understanding in advance. The first row is the common case: a build error or a failed migration, and your app keeps running as it was. The other two happen after the new version has taken the old one’s place, because each app runs on a single instance and a release replaces it. The app stays down until a version that starts is deployed, which is either a fix or the previous code put back as above.

Undoing code does not undo a migration

Putting old code back does not reverse a database migration. If the deploy you are undoing added a column, dropped a table, or rewrote data, the old code now runs against the new schema. Sometimes that is fine, because the old code simply does not know about the new column. Sometimes it is not, because the old code selects a column the migration renamed.
Before putting code back past a migration, know what the migration did. Redeploying old application code is safe. Reverting a schema is not, and no platform can do it for you without risking your data. The pattern that avoids the problem is additive migrations that both the old and new code tolerate.

Deciding quickly

When something is wrong in production, the useful question is not what broke, it is whether the previous version was fine. If it was, put it back first and diagnose after. A few minutes of redeploying the old code beats twenty minutes of debugging under pressure. Once you are no longer on fire, the deployment list gives you the commit each deploy built, so the difference between what worked and what did not is one comparison away.

Health and alerts

Health checks run every few minutes, and you are emailed when an application changes state rather than on every check. That is usually how you find out you need this page.