You don't need to undo a mock move, it should not have affected a board when it was used, you simply get the returned value as if the move(s) got played.
The way it works is that the move or moves get played on a temporal copy of the board, then we save the returned value without a reference, and then remove the temporal board, but the original board where it was called from should remain unchanged, there is no need to undo anything :)
You can quickly test it on the demo and sending on the console Ic.getBoard("main").playMove("Nc3", {isMockMove: true}), no move will be sent but you will get:
You don't need to undo a mock move, it should not have affected a board when it was used, you simply get the returned value as if the move(s) got played.
The way it works is that the move or moves get played on a temporal copy of the board, then we save the returned value without a reference, and then remove the temporal board, but the original board where it was called from should remain unchanged, there is no need to undo anything :)
You can quickly test it on the demo and sending on the console
Ic.getBoard("main").playMove("Nc3", {isMockMove: true})
, no move will be sent but you will get: