Table of contents11
Last month I broke a client’s checkout page with one careless line of code. I was editing the theme’s functions file, hit save — and the whole page turned into a white screen. My heart dropped. The client was running ads that afternoon, and every minute the page stayed broken was money burning.
I did not panic. I had a backup from the night before — but I did not restore the entire thing. That would have wiped out everything the client had added that morning: new orders, new form submissions, new comments. Instead, I pulled one single file out of the backup and put it back where it belonged. Ten minutes later the site was fine.
I am Daniel Okafor, and I have been fixing broken WordPress sites for clients for six years. Restoring a single file is the most underrated skill in WordPress maintenance. Most people only know the big red “restore everything” button, and that button is a sledgehammer when you usually need a scalpel.
Here is the fear I hear all the time: “If I touch the backup, I might make things worse.” I get it. But a full restore is actually the riskier move — it rolls back your database too, which can delete today’s orders and comments. Pulling out one file is safer, faster, and exactly what this guide teaches.
In this guide I will show you the exact process I use: open your backup archive, find the one file you need, put it back in the right place, and check that everything works. Whether it is a theme template, a config file, or a single database table, you will know what to do.
This is for site owners who already have a backup and just need one file back. If you can download a file and upload a file, you have all the skills you need.

Here is what this guide covers:
- Why Restoring One File Beats Restoring Everything
- What Your WordPress Backup Actually Contains
- Finding the File You Need Inside the Archive
- Method 1: Restore Through Your Hosting File Manager
- Method 2: Restore Through FTP or SFTP
- Restoring a Single Database Table (When the Problem Is Data, Not Files)
- How to Check the Restore Actually Worked
- Mistakes That Make a Simple Restore Go Wrong
- Frequently Asked Questions
- Final Thoughts
Ready? Let us get that file back.
Why Restoring One File Beats Restoring Everything
Most backup tools give you one big, tempting button: restore. It looks like the answer to every problem. But that button usually replaces your files AND your database with older versions — a full time-travel trip for your whole website.
Think about what happens between the backup and now. A full backup made at midnight erases everything since: orders placed this morning, comments left by readers, new user registrations. I once watched a store owner restore a full backup to fix a broken logo — and delete 34 orders in the process. The logo was fixed. The accounting was a mess for a week.
Here is the deal: most website problems are single-file problems. A theme update breaks one template file. A bad edit kills one config line. When the damage is one file, the fix should be one file. You keep everything else exactly as it is — today’s data stays, today’s content stays, and only the broken piece goes back to yesterday’s version.
What Your WordPress Backup Actually Contains
Before you can pull one file out, you need to understand what you are looking at. A full WordPress backup is really two things packed together: all the website files, and a copy of the database.
The files part usually arrives as a zip archive. Open it and you will see the familiar WordPress structure: wp-admin and wp-includes (the core engine — you almost never restore individual files from here, since you can just reinstall WordPress), and wp-content, where everything unique about your site lives: themes, plugins, and uploads (every image and document you ever added).
The database part is usually a .sql file — a long text file of instructions that rebuilds your posts, pages, settings, and comments. Broken design or a white screen? You almost always need a file. Missing post or scrambled settings? You need the database part.
The two most common single-file victims: functions.php inside your active theme folder (wp-content/themes/your-theme-name/functions.php) — one bad snippet here white-screens the whole site — and .htaccess in the site’s root, which controls redirects and security rules. Knowing these two locations by heart will save you hours. For a broader refresher on how site files fit together, see [how to install WordPress plugins safely](https://hyperdaf.com/how-to-install-wordpress-plugins-safely/).
Finding the File You Need Inside the Archive
You do not need special software. Download the backup to your computer and open the zip with your computer’s built-in tool — double-click works on both Windows and Mac. Inside, click through the folders like your own hard drive until you reach the file you need, then extract just that one file to your desktop. You have rescued it without touching anything else.
If you can, compare it with the broken one — open both in a text editor. Sometimes you spot the mistake immediately: a missing bracket, a line you added this morning. Even if you do not, the comparison confirms the backup file is the older, working version.
One honest warning: make sure the backup predates the problem. I once restored a “working” file from a backup made after the breakage — the file was already broken inside it, and I wasted an hour wondering why nothing changed. The backup date matters more than anything else in this whole process.
Method 1: Restore Through Your Hosting File Manager
Most hosting accounts include a file manager in the control panel — a web-based way to browse your site’s files without installing anything. This is the fastest method for most people.
First, make a safety copy of the broken file. In the file manager, navigate to the file’s location, select it, and copy or download it. Rename your copy something like functions.php.broken. This sounds paranoid, but it has saved me more than once — if the backup file turns out to be wrong too, you can get the original state back in seconds.
Next, upload the rescued file from your desktop into the same folder, replacing the broken one. The file manager will ask if you want to overwrite the existing file. Say yes. That is the entire restore — one file in, one file out, everything else untouched.
Then clear your cache before you check the result. If your site uses any caching, the browser or server might keep showing the old broken page even though the file is fixed. Clear the site cache and reload in a private window. For the full walkthrough, see [how to clear WordPress cache, every method that works](https://hyperdaf.com/how-to-clear-wordpress-cache-every-method-that-works/).
A quick note on permissions: the upload usually keeps normal permissions automatically. If the site throws a 500 error after your upload, check the file permissions in the file manager — files should typically be 644 and folders 755. Wrong permissions after an upload are a common cause of mysterious errors, and fixing them takes ten seconds once you know where to look.

Method 2: Restore Through FTP or SFTP
Connect with an FTP client using three things from your hosting account: the server address, your username, and your password. Use SFTP instead of plain FTP whenever your host offers it — SFTP encrypts the connection, plain FTP does not.
Navigate to the file’s folder on the server side. Before you upload, download the broken file and rename it with .broken at the end — the same safety-copy habit as Method 1. Drag the rescued file over, confirm the overwrite, and check permissions afterward: right-click the uploaded file, choose file permissions, and make sure it reads 644.
FTP shines when the file manager is unavailable — for example, when a broken file has locked you out of the control panel entirely, or when you need to restore several files from different folders and dragging is faster than clicking through a web interface. Both methods end at the same place: one correct file sitting where the broken one was.
Restoring a Single Database Table (When the Problem Is Data, Not Files)
Sometimes the broken thing is not a file at all. A post vanished. Your settings page shows the wrong values. A plugin update scrambled its options. Those live in the database, and restoring the whole database would wipe today’s content — the exact problem we are avoiding.
The good news: you can restore a single table from the .sql file in your backup. Open your database management tool in the hosting control panel (usually phpMyAdmin) and find your site’s database. Before touching anything, export a fresh backup of the current database — this is your undo button. Then figure out which table holds the broken data: posts live in wp_posts, settings live in wp_options (your tables might use a different prefix than wp_ — check what yours actually uses).
Open the .sql file from your backup in a text editor and search for the CREATE TABLE statement for that table, followed by its INSERT statements. Copy just that section. Back in the database tool, drop the broken table — the scary part, but you have the fresh export from two minutes ago — then import your copied section. The table rebuilds from the backup data, and everything else stays exactly as it is.
Honest disclosure: this is the one place in this guide where a wrong click has real consequences. If databases make you nervous, ask your host’s support team — restoring one table is a routine five-minute request for them, and there is no shame in it.
How to Check the Restore Actually Worked
Do not trust the file manager’s “upload successful” message. Verify like a detective. First, load the broken page in a private window with cache cleared. Does it look right? Click the things that were broken. Second, compare timestamps: in the file manager or FTP, check that the file’s “last modified” time is now — not some older date. A wrong timestamp means your upload went to the wrong folder, the most common silent failure in single-file restores.
Third, watch the site for an hour. Some problems are intermittent — a restored file might fix the white screen but reveal a second issue underneath. Browse a few pages, check the contact form, glance at your error log if your host provides one. If everything is quiet after an hour, you are done. And write down what happened: date, what broke, which file you restored, which backup it came from. Future-you will thank present-you.
Mistakes That Make a Simple Restore Go Wrong
The number one mistake is restoring from the wrong backup date — always confirm the backup predates the problem. Number two is restoring the wrong file: functions.php exists in every theme, so restore the file from the theme that is actually active.
Number three is forgetting the cache. You restore the perfect file, load the page, see the same broken page, and conclude the restore failed. It did not fail — you are looking at a cached copy. Clear everything and check in a private window before touching anything else. Number four is restoring to the wrong location: backup archives sometimes contain the site inside an extra folder (like public_html/your-site/). Match the folder path exactly, or nothing changes on the live site.
The fifth mistake is the most human: no safety copy of the broken file. “I will remember what I changed” is a famous last sentence. Download the broken version first, every time. Disk space is cheap. Regret is expensive.

If your restore attempts keep failing and the site is still down, you may need the bigger hammer after all — a full restore. That process is covered in [migrate WordPress to a new host with zero downtime](https://hyperdaf.com/migrate-wordpress-new-host-zero-downtime/), which walks through full-site moves that use the same backup principles.
A Bonus Tip: Test Your Backup Before You Need It
I learned this from a painful experience. A client’s site went down, I reached for the backup, and discovered the last three months of “successful” backups were all empty zip files. The backup job had been failing silently. We recovered — barely — from an older copy. Now I test every month, and it takes five minutes. A backup you have never opened is a hope, not a plan.

Frequently Asked Questions
Can I restore a single file if I only have a full-site backup? Yes. A full backup is just an archive containing all your files. Open it, navigate to the one file you need, extract it, and upload it back to the same location. You never have to run the full restore process.
What if my backup is stored on the server and I cannot download it? Most backup tools let you download the archive through their interface or your hosting file manager. If the file is too large, you can often extract just the single file on the server itself. As a longer-term fix, see [manual backups vs backup plugins: what is actually safer](https://hyperdaf.com/manual-backups-vs-backup-plugins-whats-actually-safer/) — server-only backups create exactly this kind of problem.
Will restoring one file affect my posts and pages? No. Posts, pages, and comments live in the database, not in files. Replacing a theme file, a plugin file, or a config file does not touch your content at all. That is the whole point of the single-file approach — your content stays exactly as it is.
What should I do if the restored file does not fix the problem? Clear all caches and check in a private window first — most “failed” restores are actually cache. If the problem persists, you may have restored the wrong file, or the real damage is in the database. Re-check the backup date too.
Is it safe to edit files directly on the live server? It works, but it is risky — one typo can white-screen the site, as my opening story shows. A safer habit: download the file, edit the copy on your computer, upload it back. And always keep the backup you restored from until you are sure everything works.
Final Thoughts
That broken checkout page taught me something I now tell every client: backups are not for disasters. Disasters are rare. Backups are for Tuesdays — for the small, human mistakes that happen on ordinary afternoons. The single-file restore is how you fix a Tuesday problem with a Tuesday-sized solution.
You now know the whole process: open the archive, find the file, safety-copy the broken one, upload the rescued one, clear the cache, and verify. It takes ten minutes once you have done it twice. The first time feels scary. The third time, you will wonder why anyone ever reaches for the big red restore button.
So here is my challenge: this week, open your latest backup and pull one file out of it, just to prove you can. Future-you — the one staring at a white screen at an inconvenient hour — will be very grateful.
Have you ever rescued a single file from a backup? What broke, and how did the restore go? Leave a comment — I read every one, and your story might reassure someone whose checkout page just broke. For backup planning, read the 3-2-1 backup strategy, how to test backups with restore drills, why to stop storing backups on your own server, backup failure causes and fixes, and how to recover a hacked site.











1 comment