My solution to this would be to enable the Assistive Touch button and set its double tap action to 'shake'. If you don't want the button all the time, create a personal automation shortcut which runs when a specific app opens and closes, setting Assistive Touch on and off as you wish.
Alternatively have Voice Control enabled and say "undo that".
There is also a three finger gesture: https://appleinsider.com/articles/19/06/27/new-ipados-button...