You should have a kind of "undo GO". If you reach less than "perfect stars" and did a "non-step-by-step"-go then add a button to undo the "go". This way you can restart you level with the last "setup" of the rails.