Is it ok to show confirmation dialog on pressing Cancel?

There is a page, which can be edited by the user, and there are two actions - Save and Cancel.

Would it be appropriate to show some kind of alert, once the user accidentally pressed Cancel after making some changes?