Guide Control Panel

How to restore a single file from a backup

Getting back one deleted or broken file without touching anything else on the site.

Updated 6 min read Beginner

Losing an entire website is rare. Losing one file — because it was accidentally deleted, overwritten by a bad edit, or corrupted by a failed plugin update — is far more common, and it does not call for restoring your whole site from scratch. Most backup tools built into a hosting control panel let you pull back a single file, leaving everything else on the site untouched.

Why restoring just one file is worth doing properly

A full account restore rolls everything back to a single point in time — every file, potentially every database entry — which also undoes any other legitimate change made since that backup. If a new blog post was published, an order was placed, or a plugin was updated after the backup was taken, a full restore throws all of that away along with the fix. Restoring only the specific broken file avoids that entirely: everything else on the site stays exactly as it is now.

Finding the right backup

Open the section of your control panel dealing with backups. You should see a list of available backup points, usually by date, and sometimes by time of day if backups run more than once daily. Pick the most recent one from before the file was lost or broken — restoring from a backup taken after the problem occurred just gives you back the same broken file.

How far back backups go varies

How many backup points are kept, and for how long, depends on your hosting plan. If you need a version from further back than what is listed, check your plan's backup retention or contact support to ask what is actually available before assuming it is gone.

Restoring only the one file

Look for an option to browse the backup's contents, or to restore individual files rather than the whole account. This is usually presented as either a file browser inside the chosen backup, or a search box letting you find a file by name or path.

  1. Navigate to the file's location within the backup

    This mirrors your normal folder structure — if the file lived in your site's theme folder, it will be in the same relative place inside the backup.

  2. Choose to restore it, or download it first

    If you are unsure whether this is the correct version, download a copy and open it before committing to overwrite the live file. If you are confident, restore it directly to its original location.

  3. Decide whether to overwrite or restore alongside

    Some tools overwrite the current file automatically; others restore it under a different name so you can compare the two before replacing anything. Use whichever your panel offers, and check which behaviour it is about to use before confirming.

  4. Check the result

    Open the file, or reload the page or feature it affects, to confirm it now behaves the way it did before the problem.

Take a copy of the current, broken file first

Before you overwrite anything, save a copy of the file as it currently stands — even if it is broken. Occasionally the "broken" file actually contains a recent change you still want, just alongside the fault you are trying to fix, and having both versions to compare saves you from losing that change by accident.

If you cannot see an option to restore a single file

Not every backup tool exposes file-level restore in an obvious place — some only offer a full-account restore by default, with individual file recovery a step further in. If you cannot find it:

  • Look for wording about browsing or exploring a backup, rather than only "restore," which sometimes implies the full-account version.
  • Check whether backups can be downloaded as a complete archive — if so, you can download the whole thing, extract it on your own computer, and manually upload just the one file you need through your file manager or FTP.
  • If neither is available, contact support with the file path and the date you need it from — this is a routine request and support can usually pull the specific file from the backup on their end.

After the restore

If the file was lost because of something that will happen again — a plugin that keeps overwriting a configuration file, a script with a bug that deletes its own output, a colleague who keeps editing the wrong file — fixing the file itself is only half the job. Worth also working out why it happened, since restoring the same file repeatedly is a sign the underlying cause has not actually been addressed.

If backups do not currently cover this site at the frequency you need, setting up your own backup routine alongside whatever your host provides gives you an extra point to restore from, and testing that a backup actually works is worth doing before you need it in a hurry rather than after.

Related reading