One can (and probably should) make the argument that if your initial/incremental belief was incorrect, one should start again with a fresh prompt or roll back the tree and prompt again, disposing of the now-incorrectly generated code.
I catch myself doing this all the time. My model (local) isn't nearly as fast as something cloud-based, so there is a real incurred cost of time that is hard to shake. Very often I'll need the model to reconsider and rewrite the plan after it's already done quite a bit of work. Rolling back the code is tough, but I should resort to it more often.