I trying to manage a layer last night and I was really tired and anyway I ended up accidentally deleting it. Is there a way you can retrieve a layer that's been deleted?
Unfortunately, the Undo doesn't work on the command to restore a deleted layer (at least not in 3.1.2).
I think that's why the secondary button shows up when you press the trash can - a little "are you sure" reminder.
If you get to the 10 layer maximum, you might start a practice of duplicating the project before you delete layers.
If you don't reach the maximum layer count, just turn off the layers you don't want, then make the layer delete decision in Illustrator CC later.