In both of your examples, Mike - the resulting undo-able actions came about because (without realising, or forgetting) you had multiple images selected when you applied the action.
So (without meaning to suggest that your proposal is not valid) , another way to address your request would be to have an “Are you sure?” safety-check in-place when an action is about to be applied to more than (say) 2 images … There’s been a long-standing request for exactly that.