There's a lazy solution: do what Gmail does. Rather than have an actual undo stack, especially for those pesky things like removing information from the database, just delay action for 5-30 seconds and offer an undo button until the time expires.
You can cancel the launch. But you can't undo it. It is thermodynamically impossible.
When I clicked on "Empty Trash now" all I got was this message: "All messages in the Trash have been deleted forever."