Answers.Body: <p>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.</p>
  
  <p>For example, you would need to do:</p>
  
  <pre><code>position startpos moves e4c5
  position startpos
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-23T21:10:24.307Z
Answers.LastActivityDate: 2015-10-23T21:10:24.307Z
Answers.UserDisplayName: SmallChess
Body: <p>I checked the UCI specification <a href="http://www.shredderchess.com/chess-info/features/uci-universal-chess-interface.html" rel="nofollow">here</a> and I don't see a way to undo a move. I'm using stockfish, is there a way to do this?</p>
  
  <p>For example, how would I accomplish the following:</p>
  
  <pre><code>position startpos moves e4c5
  undo
  </code></pre>
  
  <p>With the intent of the above "undo" to result in a position of <code>e4</code></p>
  
Tags: <engines><software><stockfish><uci>
Title: UCI undo move command?
ThreadText: # UCI undo move command?
  
  (Asked by: username_0 on 2015-10-23)
  
  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
  undo
  
  With the intent of the above "undo" to result in a position of e4
  
  **Tags:** engines, software, stockfish, uci
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-10-23. Score: 4
  
  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
  
  
  ---
  
  