How to recover Destroyed prefab by DestroyImmediate()

Is it possible to recover it? I can still see the prefab but it has no prefab icon.

154241-this.png

DestroyImmediate is not recommended by Unity, they advise you to use Destroy instead. It’s meant for when you are writing editor code and can destroy assets permanently. Unity - Scripting API: Object.DestroyImmediate

If you want to ‘recover’ it then you have the option between hiding it temporarily, or destroying it and instantiating a new instance of the prefab. If it’s being used a lot, then it might be better to hide it but if you are only using it sometimes then probably destroy it and instantiate a new one whenever you need it.

Either way, to ‘recover’ it then you will want to have a reference to the gameObject to change its visibility or a reference to the prefab, so that you can instantiate a new one at any time. Make sure that the reference to this gameObject/prefab is not in a script on a gameObject that is going to be destroyed or deactived or you won’t have access to your reference anymore.

Restarting the unity do the trick. My prefab is back!