Actually, you can press 'z' to undo! Its buried in the description but the game also tells you a few levels in