There's a solution for that: Winbox (the native app, nowadays also for Linux and Mac) and the Safe mode feature.
With Safe mode enabled, once the device detects that the connection to Winbox has been lost, it rolls back the configuration back to state, when it was working.