How to roll back a Shopify theme change
You edited your theme and now something is broken: a section is missing, the layout has shifted, or the store throws an error. Shopify gives you two useful tools, and both have limits. Try them in this order.
1. Restore a single file from its Timeline
If you edited the code, the code editor keeps a history for each file. Per Shopify's guide:
- In the Shopify admin, go to Online Store, click the menu (three dots) on the theme, then Edit code.
- Open the file you changed.
- Copy the current contents somewhere safe, in case you want to keep part of it.
- In the Timeline view, click an entry to compare it with the current file.
- Right-click the entry, choose Restore contents, then confirm with Restore.
Limits that Shopify lists:
- It restores one file at a time, not a whole theme.
- It cannot recover theme files that were deleted.
- History is finite, so older versions may not be available.
- Files in the assets folder (images, CSS, JavaScript, fonts) have no Timeline history.
- Restoring replaces the whole file, including changes you wanted to keep.
In the admin the button was labelled Timeline when we checked. Some older guides and forum posts call it Older versions, so if you cannot find one, look for the other.
2. Switch back to a duplicate
If you made a copy of the theme before the change, you are in good shape. On the Themes page, publish the copy. To make a copy next time, use the theme's menu and choose Duplicate. It appears as "Copy Of" plus the theme name. A store can hold up to 20 themes, so you may need to delete an old one first, and deleting a theme is permanent. Downloading the theme as a ZIP gives you an off-site copy.
A duplicate is only a snapshot from when you made it. Anything edited in the live theme since then, including content changed in the theme editor, will not be in it.
3. If neither is available
Ask Shopify Support. If you hired a developer or used an app that changed the theme, ask them for the previous version of the files they touched. If an app injected code, removing the app and its code snippets sometimes fixes the page.
4. Where a backup app helps
Timeline and duplicates depend on you remembering to act before the mistake. A backup app does this on a schedule. It can only restore from backups taken after it was installed, so it cannot help with a change made before that.
Bucketback is a backup app we build. Every theme file is backed up nightly, and a theme can be restored per theme with a preview of what will change. A safety backup is taken before each restore, so you can undo the restore itself. Because the restore goes back to the last nightly backup, not to the minute, edits made today after the backup will not be in it.
5. Habits that help
- Duplicate the live theme before every edit session and name the copy with the date.
- Work in the duplicate, then publish when you have checked it.
- Download a ZIP of the theme before big changes.
- Keep an automatic backup running.