
Mini lesson · English
How to undo a broken website deployment
Rehearse restoring a known working release on a disposable site, then verify the visitor action actually works again.
Who is this for?
People who want a calm way to recover a broken publication. You can use the host’s release controls and a coding assistant; deployment scripting is optional.
Before you start
Your own new, disposable hosting project and the supplied working/broken pages. You will first publish working R1, then deliberately publish broken R2 only on that practice site. A coding assistant can guide the hosting steps; do not use a real user-facing service for this rehearsal.
Estimated time: 19–31 min
Estimates for the supplied starter files with prerequisite accounts and tools ready. Setup, deployment queues and delivery/DNS waits take additional time. Host controls vary. Rolling back static code does not undo database changes, sent email, payments or secret exposure.
What you will learn
- Choose a verified working release.
- Restore it through the hosting tools.
- Check the visitor task and prevent an immediate repeat.
Step 1
Choose the known working version
A previous release is useful only if it did the intended task.
Ask your assistant to publish working/public as R1 on a new disposable practice site. Open its public URL, read the R1 marker and activate “Find contact information”. Save the deploy or revision identifier whose link reaches the Contact section.
Only on this same disposable site, publish broken/public as R2. Repeat the action: R2 points to a missing target. Keep the failed R2 identifier beside the known-working R1 identifier. Now there is an actual practice failure and a specific recovery candidate.
A concrete example
The supplied R1 link targets #contact, which exists. R2 instead targets #contact-missing. An older timestamp is not what makes R1 suitable; the Contact task works there.
Use only my new disposable practice hosting project. Publish the supplied working/public version as R1 and help me verify its contact action and save its deploy identifier. After I confirm the practice target, publish broken/public as R2 only there and reproduce the contact-target failure. Then help restore the identified R1 artifact through the host, retest the same action and prevent broken R2 source from immediately redeploying. Do not touch another site, real user data or production service.Files for this step
Open or download the files below. When saving a project, keep the folder paths shown in the filenames.
How it works (optional)
Undo a broken deployment without guessing
Restore the version that actually passed the affected visitor task.
Recovery starts with the user's failure, not with a vague desire to return to an older date. The workshop breaks a contact anchor in R2 while R1 contains the correct target.
A host may let you republish a previous built deploy quickly. That restores its code artifact, while the Git branch may still contain the broken source. Treat immediate recovery and permanent repair as separate actions.
Worked example
R2's page can load with status 200 while its contact action fails. A health check that only opens the homepage would miss the incident.
Extra implementation exercise
Which evidence makes R1 a suitable rollback candidate?
Show a worked solution
It is the known deploy whose contact task works, with an identified artifact/revision. “Older” alone is not evidence that a version is suitable.
- Checks the specific failed task on R1.
- Identifies its exact deployed revision.
Common mistake
Choosing a random older deploy because its timestamp is convenient.
Step 2
Restore in the practice host
Use the control for the intended disposable site.
Confirm the disposable project name and failed R2 marker with your assistant. In that host’s deploy history, select the saved R1 artifact and use its supported restore or republish control. This operation changes the practice site, not the repository’s source history.
After the host completes the action, open the actual public practice URL again. Check the R1 marker and repeat “Find contact information”; a host success badge alone does not tell you that your browser is testing the right site.
A concrete example
If the host reports R1 but the public address still shows R2, compare the project, URL and deployed artifact before declaring recovery complete.
Netlify: manage deploys and rollbacks
Try it yourself
Which version did the host restore, and what did the public address show afterward?
Discuss your answer with the lesson tutor
Show a worked solution
Illustrative recovery result: I selected the saved R1 deploy on the disposable project; its public URL now shows Version R1 and “Find contact information” reaches Contact. If that URL still showed R2, the recovery would remain unresolved regardless of the host badge.
- Names the selected R1 artifact and confirms the disposable project target.
- Checks the public R1 marker and the formerly failing contact action after restoration.
Files for this step
Open or download the files below. When saving a project, keep the folder paths shown in the filenames.
How it works (optional)
Rehearse rollback in a disposable project
Use deploy history to publish the known working artifact.
Follow START-HERE.txt only on your practice host. Record R1, release the intentional R2 fault and reproduce the broken contact task. Then locate R1 in deploy history and use the host's publish/rollback action.
Inspect the resulting public URL and version marker after the action completes. Hosting interfaces and permissions differ; consult the current host guide rather than relying on an old button position.
Worked example
The public page must now show R1 and the contact link must reach the actual contact section. The dashboard action alone is not the completed recovery check.
Netlify: manage deploys and rollbacks
Extra implementation exercise
The dashboard says the previous deploy was published. What should you check next?
Show a worked solution
Confirm the public artifact/version and repeat the contact action. Record the result rather than assuming a successful control-plane action proves user recovery.
- Opens the actual public URL/version.
- Repeats the previously failing task.
Common mistake
Ending the incident as soon as the rollback button succeeds.
Step 3
Prevent the same failure returning
Recovery and fixing the next publication are separate jobs.
Repeat the Contact task on restored R1. Then ask the assistant to inspect the repository copy: the broken R2 link may still be there even though the host is serving the older working artifact.
Have the assistant repair the bad contact target in the repository and review the small change before a later publication. Keep automatic publication of the still-broken source under control using your host’s available workflow; do not assume restoring an artifact rewrites Git.
A concrete example
The permanent correction makes the link target match the existing Contact section again. It is a separate source change from republishing the already-built R1 artifact.
Try it yourself
What made the visitor task work again, and what prevents the broken version from returning?
Discuss your answer with the lesson tutor
Show a worked solution
Republishing the R1 artifact restored the working Contact task. To prevent recurrence, I would have the assistant change the repository’s #contact-missing target back to #contact, inspect that small diff and review its next preview before allowing another publication. The host rollback alone does not repair that source.
- Separates immediate host restoration from repairing the broken repository source.
- Names how the next publication will avoid reintroducing the R2 contact failure.
Files for this step
Open or download the files below. When saving a project, keep the folder paths shown in the filenames.
How it works (optional)
Repair the source and assess remaining effects
Prevent the next automatic build from restoring the same bug.
The production branch may still have the R2 code. Repair it in a reviewed source change and control automatic publication during recovery as your host supports. Otherwise the next deploy may reintroduce the fault.
Code rollback does not recover deleted records or undo messages/charges. A database schema change may also make old code incompatible. Investigate those effects separately before applying a rollback to a real stateful app.
Imagine R2 removes a database column while R1 still reads it. Republishing R1's old code will not recreate the column, so a code rollback may still fail. Check state/schema compatibility first. For this static exercise the repair is smaller: change href='#contact-missing' back to href='#contact', review the diff and verify the repaired branch before future automatic publication.
The database example explains a limit of rollback in a stateful app; this workshop itself changes only static files and asks for no database actions. If you are learning alone, perform the runbook from a fresh browser window and read it as instructions for someone who did not write the change.
Worked example
Restoring an old form page cannot unsend email already delivered by the newer version. If credentials leaked, rollback alone also does not revoke them.
Extra implementation exercise
A rollback restores the page, but the broken commit remains on the production branch. What risk remains?
Show a worked solution
A later build can publish the bug again. Fix or revert the source through the normal review process and verify the resulting release before restoring unattended deployment.
- Anticipates automatic redeployment of the bad source.
- Plans a source repair and verification.
Common mistake
Assuming deployment rollback also rewrites Git history and external state.
Step 4
Write the recovery handoff
Make the next incident easier to understand.
Complete recovery-record.txt with the failed R2 task, the saved R1 deploy identifier, the host restoration and the public Contact retest. Add the repository correction or the exact next step still needed.
This rehearsal restores static website code. It does not undo database changes, sent email, charges or exposed keys; those would need their own recovery action in a real incident.
A concrete example
A compact recovery story is: R2’s target was missing → republished known-working R1 → public R1 Contact worked → repaired and reviewed the source before the next release.
Try it yourself
Start with these materials
The starter files and test content are supplied. A live verification still requires your own permitted provider account, inbox or domain as listed under prerequisites. Local inspection is possible without them; record the live step as not tested until you actually perform it.
Provide the recovery record and actual restored-task check.
What to produce A recovery record with the restored version, actual task result and prevention step.
Discuss your answer with the lesson tutor
Show a worked solution
Illustrative record: R2 displayed normally but its Contact target was absent. I restored the recorded R1 artifact on the disposable host and the public Contact task worked again. The repository target still needed correction and preview review before another publication. No database, mail or payment recovery was part of this static rehearsal.
- Connects the failed R2 version, restored R1 artifact and actual public task retest.
- Includes recurrence prevention and distinguishes code rollback from data or external side effects.
Files for this step
Open or download the files below. When saving a project, keep the folder paths shown in the filenames.
How it works (optional)
Your assignment: write and prove a short recovery runbook
Make the next recovery executable by someone who did not write the change.
Complete the recovery record with exact deploy/source identifiers, the failed task, rollback action and user-visible check. Include the source repair and any state outside rollback scope.
Have another person follow the written steps against the disposable site or walk through them from a fresh browser. Remove assumptions such as “click the old one” that only make sense to you.
Worked example
A useful runbook says which version to choose and how to tell recovery worked. A list of dashboard clicks without a task check is fragile.
The complete reference walkthrough is available in reference/assignment-walkthrough.txt. Compare its steps with your own result; fill the test record from observations in your own project.
Extra implementation exercise
Produce a recovery record that restores the test task and prevents immediate recurrence.
Show a worked solution
On the disposable site, reproduce the R2 contact failure and record its deploy ID/commit. In deploy history, locate the known working R1 record, inspect its artifact/revision and choose the provider's publish/rollback control for that record.
Open the actual public URL, read R1 and repeat the contact action. Then repair the broken source by restoring href='#contact'; review/commit that change before allowing later automatic publication.
Keep code restoration separate from data recovery. If a newer version removed a column required by old code, republishing old HTML/JS will not recreate it. The reference incident record names the recovered task, source fix and state outside rollback scope.
- Restored version passes the exact failed task.
- Source repair and non-code effects are explicitly addressed.
Common mistake
Writing recovery instructions only after forgetting which deploy fixed the problem.
Was this lesson useful?
Leave a like, or share it with someone who could use it.
Continue learning
- How to build your first personal website
- How to publish your website from GitHub
- How to connect a custom domain to your website
- How to set up email on your own domain
- How to make your website usable on phones
- How to make website images load faster
- How to get website feedback in your inbox
- How to add email subscriptions to your website
- How to send automated emails from your website
- How to save form submissions in a database
- How to let people sign in to your website
- How to keep a page private
- How to let users edit their profile information
- How to let users upload images
- How to keep API keys out of your frontend
- How to show data from an external API on your website
- How to add an AI chatbot to your website
- How to make a chatbot answer from your own content
- How to add a blog to your website
- How to add search to your website
- How to add another language to your website
- How to help Google find your website
- How to fix your website preview when sharing a link
- How to measure visits and useful actions on your website
- How to let visitors book an appointment
- How to accept a payment on your website
- How to preview website changes before publishing
- How to back up and restore your website data
- How to find and fix errors on your live website