Use JS condition dynamically: apex.page.isChanged()
apex.page.isChanged()
True: Shows a confirmation dialog (P1002_CONF_MESSAGE item), then Submit with Rest.
Rest.
False: Submit with RESET.
RESET