Unless you use shift-delete, there is a warning before you delete something. You might expect that the warning is just something you need to click away, but actually it should be used as a moment to think if you really want to delete it.
You can“t blame the system for not checking what you were deleting before you deleted it.