How do I know that actor is deleted from the map in the editor

I have an actor what does some stuff when somebody adds it to one of the levels. (It runs when it is constructed). But I want to revert that modifications if the actor is deleted from the level, and ONLY if deleted. I tried it when it gets destroyed, and it is not beginplay not yet fired,but it got destroyed when I close the editor. So the issue is it reverts everything everytime when I close the editor. Does somebody know what event fires when something is deleted from the level in the editor? I can live with some workaround too, if somebody has any.