All posts

Roll back a broken deploy on Netlify, Vercel, Lovable and Bolt

You changed something, the new version went live, and now login fails or a button does nothing. Here is how to undo it on each host, what an undo does not fix, and how to make the next deploy safer. Vendor facts come from each vendor's own docs, checked in November 2026. Screens change, so open the linked page if a button looks different.

Short answer: roll back the code first and look for the cause after. A rollback puts the old version back in seconds. It does not undo database changes, data the bad version wrote, emails it sent or payments it handled. Check those separately.

1. The first 10 minutes

  1. Confirm it was the deploy. When did the last deploy go live, and when did the problem start? If the times match, the deploy is the first suspect. If nothing was deployed, look elsewhere: an expired key, a used-up quota, a service that is down.
  2. Roll back to the last version that worked. Look for the real fix later, not while customers are stuck.
  3. Check the main path. On your phone, in a private window, sign in and do the main thing your app is for.
  4. Then read the logs of the bad deploy, the same day. Some hosts keep them only briefly (see uptime checks and error alerts).

2. How to roll back on each host

Netlify

Netlify's manage deploys page: open your site's Deploys list, click a deploy that worked, and on its detail page click Publish Deploy. Nothing is rebuilt, and the docs say rollbacks are instantaneous.

Then watch the next push. If your site deploys from Git with auto publishing on, the next production deploy from Git overwrites your rollback. If that push may not be the fix, click Lock to stop auto publishing in the Deploys list. Netlify still builds new deploys but does not publish them. Later, click Unlock to start auto publishing.

How far back: Netlify deletes deploys after 30 days by default, or 90 on paid plans.

Vercel

Vercel calls it Instant Rollback. On your project's overview page, the production deployment tile has an Instant Rollback button. Pick a deployment, click Continue, check the details and click Confirm Rollback.

  • How far back. On Hobby, only to the previous deployment. On Pro and Enterprise, to any deployment that was once live on a production domain.
  • New pushes stop going live. After a rollback, Vercel turns off auto-assignment of production domains, so your next push builds but does not replace the rollback. To go back to normal, click Manage on the production deployment tile, pick a deployment to promote and click Confirm, or run vercel promote.

Lovable

Lovable's version history page: open the History toggle in the top bar of the editor, find a version that worked, click Revert and confirm. This restores your project's code only, and redeploys your edge functions to match. Very old versions can be previewed but not restored.

The live site is a separate step. Lovable's publish page says the live site keeps showing the version you published until you publish again. So after the revert, click Publish, then Publish changes.

Bolt

Bolt's version history page: click Version history (the clock icon) in the top menu, pick a version, click Restore this version and confirm with Restore version.

Bolt's publish page says changes are not applied to your published site automatically. Open the Publish menu and click Update.

Plain GitHub

If your host deploys from GitHub, you can undo the change in the code. That is also the usual way once a Lovable or Bolt app lives in your own GitHub and hosting. git revert <commit> makes a new commit that undoes the bad one. Push it, and your host deploys it like any other push. For a merged pull request, GitHub's revert guide shows a Revert button near the bottom of it. It opens a new pull request that undoes the merge.

Use revert, not reset. Git's docs explain the difference: revert makes a new commit, reset moves your branch back and changes the commit history. Pushing a reset needs --force, which the git push docs warn can make the remote repository lose commits. And remember: after a Vercel rollback or a Netlify lock, your revert waits until you promote or publish it.

3. What a rollback does not undo

A rollback swaps the code. Everything outside it stays the way the bad version left it.

  • Database changes. If the bad version added, renamed or removed a column, that change stays, and the old code may fail on it. Data the bad version wrote also stays, wrong data included.
  • Environment variables. Netlify's functions docs say each deploy uses the values that were set when it was deployed. Vercel says a rollback won't update environment variables you change in the project settings. So a rollback can hide a bad value. Fix the setting too, or the next deploy brings the problem back.
  • Emails already sent. Decide whether a short correction is needed.
  • Payments and webhooks. What the bad version handled stays done. Check your payment dashboard for that time.
  • Settings in other services. Login redirect URLs, DNS records, webhook addresses. If you changed them for the new version, change them back by hand.

Lovable and Bolt databases. Neither version restore brings data back. Lovable's history page says a revert does not restore or roll back your database data, and later data changes or migrations stay. Bolt's page says restoring an earlier version will not change your current Bolt or Supabase databases.

Lovable has a separate database backup: one a day, kept for about 14 days, restored with Restore to this backup. The page warns that this cannot be undone, data written after the backup is lost, and your code may no longer match the restored database. Use it only when the data itself is broken. For other databases, see what Supabase, Neon and Firebase back up.

4. Open tabs after a deploy

Some people had your app open before the deploy. They click a link and nothing happens. A reload would fix it, but they don't know.

Modern apps load the code for a page as a separate file when it is first needed. After a new deploy, the host may no longer serve the old files, so the open tab asks for a file that is gone. In a Vite app this is a failed dynamic import. Vite's build guide describes this case and documents a vite:preloadError event for it. Its example simply reloads the page. The guide also says to set Cache-Control: no-cache on the HTML file, so a reload gets the new HTML. A rollback swaps the files too, so the same can happen to people who opened the bad version.

On my own sites, when a page file from an older deploy is missing, the page reloads once to the new version, with a guard so it can't reload in a loop. One of my sites did loop before I added the guard: a missing file made it reload again and again. If you add an automatic reload, add the guard too.

5. Prevent the next one

  • Check a preview first. Netlify builds a Deploy Preview for each pull request by default. Vercel creates a preview deployment for each pull request and each push to a branch that is not your production branch. In Lovable and Bolt, test in the editor preview: both say the published site does not change until you publish.
  • Deploy small changes, so you know what broke.
  • Run a smoke check after each deploy. A short script that loads the key pages and checks for a word on each, as in the first tests worth writing.
  • Change the database in two steps. Add first, remove later. Add the new column, deploy the code that uses it, and remove the old column in a later deploy. Then a rollback never meets a database it can't read.
  • Back up before a migration, so you have a way back.
  • Set up alerts, so you hear about a broken deploy before a customer tells you. See uptime checks and error alerts.

Checklist for the next bad deploy

  1. Compare when the problem started with the time of the last deploy.
  2. Roll back. In Lovable or Bolt, also publish the restored version.
  3. On Netlify, lock auto publishing if the next push may not be the fix.
  4. Test the main path on your phone.
  5. Read the logs of the bad deploy.
  6. Check what the rollback did not undo (section 3).
  7. Fix the cause, check it on a preview, then put it live: publish it and unlock on Netlify, or promote it on Vercel. Run your smoke check.

Before a launch, also go through the launch-ready checklist.

Want this fixed for you?

I finish and fix apps built with Lovable, Bolt, Cursor or Replit, including setting up safe deploys with previews, rollbacks and checks after each deploy. Or send me the details on the hire page and I'll reply within 24 hours.