Let's say I'm not happy with the changes my agent
applied here, and I accidentally already accepted them
reviewing them closely. You can always undo
what the AI did. For one, of course, you could use version
control and Git to create commits and go back to older commits, and that's
always a good idea. But inside of your chat
sessions, you also have this restore checkpoint
button here, and that will simply undo that last
result that was generated by the agent.
You can also restore by clicking on your message
before a certain action was performed, and you can then edit
it, and for example, say, "Comment all your changes in the
code." And if you then submit this, it will also undo that
result that came after the original message and redo it
based on your new instruction. Here it also tells me
that it will remove my last request and redo everything, though you
can, of course, disable this box. So now, it
also restored the code to the previous checkpoint and now rewrites
it, and what's, of course, worth noting is that these AI
systems are not deterministic. So the result you get now,
even if it were exactly the same instruction as before, is not
necessarily the same as we had before.
It's not guaranteed to be the same because there is some randomness
involved. But, of course, it's very important to know about this
checkpoints feature because if AI does mess something up and you wanna
undo it, including maybe files that were deleted or something like
this, you can just restore and you'll be
fine.