Accidental asset deletion recovery?

I accidentally deleted a terrain I’d worked on quite a bit. I figured since I hadn’t saved the scene yet, I could simply close without saving changes (which I did), and reopen it to find my terrain in the state it had been in before I’d begun the days work.

But it wasn’t there! The error said the terrain data was missing. I went looking for said data but have been unable to locate it. Any notions of how I might recover it? Or, even if it’s possible?

If not, the lesson learned will be that it’s possible to open a project, work on it, and lose that work even if you haven’t saved your changes…?

1 Like

It’s in the trash.

Depends on what you’re working on. If you mess around with a scene and don’t save changes, then nothing you did will be recorded. If you’re working directly on an asset (like a terrain), then whatever you do to it takes effect immediately.

–Eric

1 Like

By “It’s in the trash” do you mean it’s unrecoverable? I’ve taken things out of the trash before :slight_smile:

Appreciate the feedback :~).

No, I mean it’s in the system trash. Or recycle bin, if that’s what you have. :wink:

–Eric

1 Like

Yup, it was there. Thank you very much! :~)

i deleted my assets on accident too but it mine arent in the trash. I coppied over a folder called assets over my projects asset folder and everything inside was gone except what i tried copying into it. I assume the folders were going to merge not overwrite… Im on a mac so is there anyway to get those files back?

For future reference for anyone else finding this page, if you delete a folder (I just accidentally deleted my prefabs folder, instead of a specific prefab) from within Unity itself, it’s gone forever. IF you deleted it in Windows Explorer, it should go to the Recycle Bin (and equivalent for Mac of course). My own stupid fault, but really annoying!!! Now I need to find out if there’s a way to reverse link GameObjects back to a prefab, since I’ve already built a lot of scenes, and don’t really want to rebuild them all…

If you’re on Windows 7, just head over to your trash, choose the option to see the most recently deleted and click on it. On the popup, click ‘Restore’. Wait a few seconds, head back to Unity and it’s restored!

No need for a recycle bin if you use source control :wink: I recommend Mercurial, it saved me a ton of times

Hello! I accidentally deleted a prefab in Unity, and I was wondering if anyone knows where someone can find the recycling bin for Unity since I’m unaware of how to access it. Thanks!

It’s the one configured for your operating system.

I’m sorry you’ve had this issue. Please consider using source control in order to guard and protect your hard-earned work.

Personally I use git because it is free and there are tons of tutorials out there to help you set it up.

Here’s how I use git in one of my games, Jetpack Kurt:

https://forum.unity.com/threads/2-steps-backwards.965048/#post-6282497

Using fine-grained source control as you work to refine your engineering:

https://forum.unity.com/threads/when-to-make-a-separate-object-or-class-script-help-me-think-like-a-programmer-example-in-text.1048739/#post-6783740

Share/Sharing source code between projects:

https://forum.unity.com/threads/your-techniques-to-share-code-between-projects.575959/#post-3835837

Setting up the right .gitignore file:

https://forum.unity.com/threads/removing-il2cpp_cache-from-project.1084607/#post-6997067

1 Like

I just deleted an entire terrain of carefully placed trees and plants and buildings. I tried ctrl z ing my way back but it said the data was lost and it is not in recycle bin. Does this mean its lost forever?

Yes, it’s gone forever. Just like they said in the other posts above from two years ago.

Source Code Version Control

For daily work, you should be using a Version Control System (VCS). This is like a time machine, saving a copy of your file between each set of changes you make, letting you recover an older version of the file before you made changes you don’t like, or recover the most recently saved version if you delete it. Every time you get to a stopping place where you added some new feature, check in with the VCS, so it will keep the latest changes for you.

There are many free and paid tools which offer VCS services, such as GitHub or Unity’s own PlasticSCM. Just be careful not to share third-party asset files into a public cloud account where you’re liable for unlicensed copies.

Regular Full Backups

Every time you reach a big milestone in your work, you should be making a full backup of your project to an external drive you keep in a safe place. This is for disaster recovery, in case you’re locked out of cloud system accounts or your computer explodes. A simple ZIP file of your whole project folder is fine. If you absolutely must shrink the size of your backups, you can skip adding the project’s Library sub-folder to your backups; it will take a little longer to restore but saves more than half of the data storage.

A full backup is not a convenient daily work VCS solution, and a VCS is not a full backup disaster recovery solution. You should do both, for Unity or any other computer work, like your college homework, your digital photo albums, or the documents for a multi-million dollar business.