You can restart the level from the menu. R is undo one step.
Ah, I didn't realise r was undo. Thanks for clarifying!