Rollwell Coming soon · not built yet Join the waitlist

← Rollwell home

How to roll back a GitHub Pages deployment

GitHub Pages has no rollback button. To roll back, you put the last good version of your site back on the branch or workflow that Pages publishes from, then let the deployment run again. The usual way is to revert the bad commit with git and push.

Find the last good commit

Look at the recent history of the branch your site publishes from. Find the commit where the site still worked, and the commit that broke it.

git log --oneline -10

Note the short hash of the bad commit. If you are not sure which one it is, open the site at an earlier commit locally and compare.

Revert and push

git revert adds a new commit that undoes the bad one. It keeps your history intact, so it is safe on a shared branch.

git revert <bad-commit-hash>
git push origin main

Replace main with the branch your site publishes from. If the bad change spans several commits, revert each one, newest first.

Check the Actions run

The push starts a new deployment. Open the Actions tab of your repository and look for the newest run. When it finishes with a green check, reload your site. A browser or CDN cache can show the old page for a short time, so try a hard refresh.

If the run fails, open it and read the log of the failed step.

Or redeploy an earlier commit

If your site is published by a GitHub Actions workflow, you may be able to run it again for an older commit. Check out the good commit in a new branch, and push that branch if your workflow allows it as a deployment source.

git switch -c rollback-good-state <good-commit-hash>
git push origin rollback-good-state

Whether this deploys depends on your workflow and on any environment protection rules you have set. Read the docs below for your setup.

Official docs

Settings differ between setups, so check GitHub's own pages:

Rolling back on several hosts?

Rollwell is not built yet. It is planned to roll back sites on Netlify, Vercel and GitHub Pages from one place. Nothing is charged.

Join the Rollwell waitlist