I checked the UCI specification here and I don't see a way to undo a move. I'm using stockfish, is there a way to do this?

For example, how would I accomplish the following:

position startpos moves e4c5

With the intent of the above "undo" to result in a position of e4

1 Answer 1


Unfortunately the UCI protocol is stateless, there is no way to ask the engine to undo a move. The protocol is designed for communication between GUI and engine, you are supposed to have your own board representation such that you can update the engine.

For example, you would need to do:

position startpos moves e4c5
position startpos

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.