If customers cannot buy right now and you have a theme that you know works, publish that theme first and diagnose the broken one afterward. Otherwise, duplicate the broken theme before you change anything, then use the recovery method that matches what broke.
This guide covers themes broken by code edits, pasted AI-generated code, Theme Editor changes, apps, or developer work. If your customizations disappeared during an official theme update, use our guide to restore customizations lost after a Shopify theme update instead. We tested the steps that Shopify's documentation does not cover on a demo store running our own theme built on Horizon 4.2.0, in September 2026.
Roll back first when customers cannot buy
In Online Store > Themes, preview your most recent working theme and check a product page, add to cart, and the route into checkout. If those work, publish it. Shopify keeps the replaced theme in the theme library. Rename it with the date and a short note, such as Broken 2026-09-26 after header edit, and leave it unedited as evidence.
The older theme brings back its own settings, templates, and customizations. A product assigned to a custom template falls back to its default template if the published theme does not contain that template. Products, collections, menus, pages, and metafields live outside the theme, so a rollback does not change them.
Undo a broken code edit
When an edit to one existing file broke the store, open that file under … > Edit code, compare its earlier Timeline entries, and choose Restore Contents. Shopify's guide to editing theme code shows each step.

Restoring replaces the whole file, so copy its current contents first if it holds later edits you still need. Timeline history is finite, it cannot recover deleted files, and files in the assets folder have no Timeline history.
Fix layouts broken by Theme Editor changes
The Theme Editor saves global values such as the logo, colors, and fonts in config/settings_data.json, and page layouts and section settings in JSON templates such as templates/index.json for the homepage.
Shopify's documentation does not say whether these saves appear in Timeline. In our test, they did. Each Theme Editor save created a new Timeline entry for the file it changed, Compare with Current showed the exact setting that changed, and Restore Contents brought back the removed logo.

This also covers code pasted from an AI tool into a Custom Liquid section or block. That code is saved in the page's JSON template, not in a Liquid file. In our test, the block appeared in the Timeline of templates/index.json, and restoring the earlier version removed it. You can also remove or hide the block in the Theme Editor.
Restore only the affected file, and check its later entries first. Restoring a template or settings_data.json also reverses every later change saved to that file, including changes you made on purpose.
Rule out an app change
If the break started after an app was installed or changed, turn off its embed under App embeds in the Theme Editor, or hide its app block, in a duplicate theme. If the problem disappears, contact the app developer. Avoid uninstalling as a test, because it can remove configuration outside the theme. Some apps also add code directly to theme files, which stays after the embed is off.
Find what changed when you are not sure
First, confirm the theme owns the problem. Preview a working theme, or a clean copy of the same theme, with the same page, market, and device that fail. If the problem appears in every theme, check store settings, product data, and apps instead. Shopify's theme troubleshooting guide uses the same comparison.
If you know roughly which files were edited, open the same file in the code editor of both themes and compare them side by side. Copy the working version into a duplicate of the broken theme, then test.
If you have no idea what changed, a modern theme has hundreds of files, too many to compare by hand. Select … > Download theme file for both themes. Shopify emails each one as a ZIP file. Upload both files to an AI assistant that accepts file uploads, or give them to a developer. A prompt like this works:
These are two versions of the same Shopify theme. working.zip works correctly.
broken.zip has this problem: [what fails, on which page or device, and since when].
List every file that differs, identify the changes that most likely cause the
problem, and quote the exact lines from both versions.
In our test, ChatGPT compared both theme files, listed the three files we had changed, and named snippets/header-actions.liquid as the direct cause of the missing cart icon. It marked the other two changed files as unrelated to the problem.

One test does not show that every assistant will find every change. Confirm that the quoted lines exist in the broken theme before you change anything, and apply fixes to a duplicate. Some themes contain API keys added by apps or developers, so check for them and review the AI tool's data settings before uploading.
Restore a downloaded backup or a deleted theme
A downloaded theme file can be added back under Add theme > Upload zip file. It arrives as a new, unpublished theme. Preview it, and check its app embeds and edited theme text before you publish.
This is also the only route back after a deletion. Shopify describes deleting a theme as permanent, with no restore option. Without a duplicate, a downloaded theme file, or a copy your developer keeps, you can add a clean copy of the theme, but its custom code and settings are gone.
Verify before you publish
Repeat the steps that failed originally, then check:
- A product page with variants, add to cart, the cart, and the route into checkout.
- The homepage, a collection page, and any template that uses a recovered file.
- Mobile and desktop, and each active market and language.
- App embeds, analytics, and the browser console for new errors.
Keep the broken copy and the rollback theme until the recovered version has run cleanly on the live store. Before the next developer, app, or pasted code touches your theme, duplicate it and name the copy with the date and reason, such as Backup 2026-09-26 before size chart.
When to stop and get help
Pause when you cannot identify what changed, several people or apps edited the same files, or the failure affects checkout, tracking, or several markets. Our Shopify Bug Fix service covers one clearly defined issue. For a wider recovery, we diagnose the problem first, then confirm scope and price before work begins.