I deleted a file or folder by mistake: how to get it back from a backup

If you deleted a file or a folder, getting it back is almost always quick and does not need a restore of the whole account. First look in the File Manager trash; if it is not there, open JetBackup 5 (Files section), browse into a copy from a day when the file still existed, and download just that piece, or restore just that path.

First, the cheap checks

1 The File Manager trash. In cPanel, in File Manager, look for the Trash button. Whatever you deleted there may be sitting in it, and a click puts it back. If the button is not there, move on.
2 The right place? Many “missing files” are in another folder, or the site is looking for them at a different path. Confirm the exact path before recovering anything.
3 A plugin or a theme? If it was a plugin folder, the simplest thing is to reinstall it from the WordPress dashboard, no backup needed. The images and the content you uploaded (the wp-content/uploads folder) are what only a copy can bring back.

Recovering from JetBackup

1 Pick the right day. The last day on which the file still existed. The available days show in the list; they are the copies of the last 30 days.
2 Choose “files and folders” and browse to the folder the file was in. The account lives under /home/YOURACCOUNT, and the site is usually in public_html.
3 Download instead of restoring if you have doubts. You get the file on your computer and decide later what to do with it. It is the safest road.
4 Or restore just that path. Tick only the file or the folder. Read what the screen says will happen to files that already exist before you confirm: putting a folder back over the top replaces what is there.
5 If you downloaded it, send it back with File Manager or over SFTP (SFTP instead of FTP) to the folder it came from. If it was one file from a folder that still exists, that file is all you need.
6 Check the permissions. As a rule, files at 644 and folders at 755. A file uploaded with the wrong permissions gives a 403 or a 500 error.
What you lost What to do
One file or one image Browse the copy and download just that file.
The .htaccess file Turn on hidden files in File Manager (Settings). Download it from the copy, or keep the current one and add the missing rules.
A whole folder of images Restore just that folder, after downloading the current one to your computer.
A configuration file Download the one from the copy and compare it with the current one: it may hold database passwords that have since changed.
The whole site See restoring a backup yourself. It is the option that throws away the most recent work.
A file created and deleted between two copies is in neither. The daily copy holds what existed that morning before dawn. If the file was created this morning and deleted this afternoon, there is nowhere to fetch it from, and only a copy of your own made in between saves it. That is what your own backup is for.
Restoring over the top also erases what changed afterwards. If you edited other files in that folder since the copy’s date, the restore sends them back to the old state. Downloading and copying only the missing piece avoids that.
Download before you delete by hand. To clean up a folder, copy it to your computer first. Five minutes save an afternoon, and the rule holds before touching a live site too (a test site before touching what is live).

Cannot find the file on any day in the list? Tell us the exact path and the date you last saw it.

Open a support ticket

SEE ALSO

How to restore your data with JetBackup

Restoring a backup yourself, without opening a ticket

How long we keep backups, and how to restore one

Day to day in FileZilla: syncing, permissions and hidden files

RECOMMENDED PRODUCT

Web hosting with cPanel

Domain and SSL included, daily backups and the panel you already know. from 5.940,00 Kz/mo (3-year plan, with coupon)

See plans
  • 0 Users Found This Useful
Was this answer helpful?