You can also do settings->accessibility->touch->back tap and set a single/double tap to send the ‘shake’ gesture.
Also AssistiveTouch gives you a menu that can be accessed on any screen on which one of the options is to simulate a shake.
It’s clunky, you look utterly ridiculous whilst doing it, but it is occasionally very useful. I’ve found that the UI gets better about putting undo arrows everywhere, though. But then even that is not really elegant.
Or tap with three fingers to bring up the tools menu, or double-tab with three fingers to undo. Still a bit clunky.