The undo feature is strictly forbidden if some else has a turn.
When you are restoring a game situation A from a game situation B:
The Undo action must never change the active player. In other words, if player X clicks on "Undo", it must NOT make player Y active.
If several players did game actions between A and B, you must NEVER provide an undo. In other words, an "Undo" action must NEVER force another player to redo some moves.
No hidden (or private) information must have been revealed between A and B.
No random event with a visible effect must have been triggered between A and B. This includes cards shuffling, dice roll, elements picking, ...