Merely removing warnings doesn’t save our work from peril, but using an “undo” function does. Let me say that again: The solution to our warning woes is undo. With a robust undo, we can close our work with reckless abandon and be secure in the knowledge that we can always get it back. With undo, we can make that horrible “oops!” feeling go away by getting our work back.
via A List Apart – Never Use a Warning When you Mean Undo. Rather than use a warning consider using the ability to just undo. Less hassle to do the action and easy to fix in the case of a mistake.