# I deleted files by accident. Can they be recovered?
Source: https://vpsdime.com/knowledgebase/troubleshooting/recover-deleted-files
Last reviewed: 2026-07-02
Summary: The honest answer for a VPS, stop writing to the disk immediately, understand that undelete tools rarely work on a live ext4 server and that we keep no copies of your data beyond your backups, then recover the real way, per-file from Nightly Backups' Browse Files, or from your own off-site backups.

## What this is

You deleted something that mattered, a directory, a database, the wrong `rm` target. Here's the honest picture of what's recoverable and how, worst news first so the good options get your attention fast.

## First: stop writing to the disk

When a file is deleted, its data blocks aren't erased, they're marked free, and **every write to the disk from now on may overwrite them permanently**. If you intend to attempt any recovery, act immediately: stop services that write (the database, the web app, logging if you can), and don't download or install recovery tools *onto the same disk* you're trying to recover from.

## The honest expectations

- **Undelete tools mostly don't work here.** Utilities like extundelete or testdisk are built for offline disks; on a **live server** that kept writing (and journaling) after the deletion, recovery odds drop fast, and partial recovery of a database's files is usually as useless as none. They're a last resort, not a plan.
- **We hold no copy of your data.** There are [no snapshots or copies on our side](https://vpsdime.com/knowledgebase/client-area/nightly-backups/nightly-backups-overview) beyond the backups you've set up, we can't "restore it from our end", however the ticket is worded.
- What actually saves you is a **backup taken before the deletion**, and there are two kinds you might have:

## If you have Nightly Backups (or a Premium VPS)

This is the good outcome, and it's self-service in minutes:

- **A few files or folders:** use **[Browse Files](https://vpsdime.com/knowledgebase/client-area/nightly-backups/recover-individual-files)** on last night's backup, a web file browser over the backup image where you can download files directly or copy them straight back to your VPS over SFTP. No full restore needed.
- **A whole database:** if you followed the [dump-nightly advice](https://vpsdime.com/knowledgebase/getting-started/backing-up-your-vps), pull the latest dump file out via Browse Files and load it. If not, a [full restore](https://vpsdime.com/knowledgebase/client-area/nightly-backups/restore-your-vps) rolls the entire VPS back to last night (everything else rolls back with it, so weigh that).
- **Timing matters:** retention is **three nights**, and tonight's backup will reflect the deletion. Recover what you need **today**, not next week.
- Windows VPS backups are restored [by ticket](https://vpsdime.com/knowledgebase/client-area/nightly-backups/nightly-backups-overview).

## If you have your own backups

Restore from your [off-site copies](https://vpsdime.com/knowledgebase/getting-started/backing-up-your-vps), restic and friends restore single files trivially (`restic restore --include /path`). This is also the moment you learn whether the backup job you set up months ago still works, which is why that guide nags about restore testing.

## If you have neither

- For genuinely irreplaceable data, the last resort is the undelete route: power the services down to stop writes and work with testdisk/extundelete (ideally against the disk image, a [full disk download](https://vpsdime.com/knowledgebase/client-area/nightly-backups/download-full-disk-image) requires the backup add-on, so on a bare VPS you'll be working live). Set expectations at "maybe fragments".
- If the data is gone, it's gone, and the only useful output of the incident is the setup that makes it a non-event next time: **[enable Nightly Backups](https://vpsdime.com/knowledgebase/client-area/nightly-backups/enable-nightly-backups)** ($5/month, tonight is your first restore point) and an [off-site routine](https://vpsdime.com/knowledgebase/getting-started/backing-up-your-vps) for the long retention. An evening of setup converts every future version of this page into a ten-minute fix.

## Still need help?

You can [open a support ticket](https://vpsdime.com/open-ticket/). So we can help on the first reply, it's worth mentioning:

- the VPS hostname or IP,
- what was deleted and when,
- whether the VPS has Nightly Backups, or you have backups of your own.

## Related questions

- "I accidentally deleted files on my VPS, can you restore them?"
- "Does VPSDime keep copies of my files?"
- "How do I recover one file from my nightly backup?"
- "Do undelete tools work on a VPS?"
- "I deleted my database, what are my options?"
