If you only lost or accidentally overwrote one file, such as an image, a theme file, or a config file, you don't need to restore your entire website. A full restore replaces everything with the version in your backup, which can undo other changes you've made since then. Instead, you can pull just that one file out of your backup archive and put it back in place.
Why Restore Just One File Instead of the Whole Backup
A full restore rolls your entire account, including your database and every file, back to the point the backup was taken. If you've added new content, installed plugins, or made other changes since then, a full restore wipes those out too. Restoring a single file lets you fix the one thing that broke while leaving everything else exactly as it is now.
Before you replace anything, make a copy of the current (broken) version of the file first. If the backed-up version turns out to be wrong too, you'll want a way to undo your change.
How to Restore a Single File
In cPanel
- Log in to cPanel and open Backup or Backup Wizard.
- Download the full account backup, or the partial Home Directory Backup if that's all you need, to your computer.
- The download is a compressed archive (usually .tar.gz). Extract it on your computer using any standard unzip tool.
- Inside the extracted folder, find the file you need under the public_html (or homedir) folder, matching your website's normal folder structure.
- Go back into cPanel and open File Manager, then navigate to the exact folder where that file belongs on your live site.
- Use Upload to upload the recovered file into that folder, replacing the existing one when prompted.
In DirectAdmin
- Log in to DirectAdmin and open Backup/Transfer (sometimes shown as Create/Restore Backups).
- Create and download a backup of your account to your computer. DirectAdmin backups are also typically a .tar.gz archive.
- Extract the archive on your computer and locate the file you need inside the domains/yourdomain.com/public_html folder.
- In DirectAdmin, open File Manager and browse to the matching folder on your live site.
- Upload the recovered file into that folder, overwriting the current version.
If your backup archive is large, extracting the whole thing just to grab one file can take a while. Most unzip tools let you extract a single file or folder from inside an archive without unpacking everything else, which saves time.
When You Should Do a Full Restore Instead
If several files are missing or corrupted, if your database is affected too, or if you're not sure exactly what changed, a full restore is safer and faster than hunting down individual files one at a time.
See How to Restore a Website Backup for the full restore process.