So you've been working with agent mode, as we did here, but now
you accepted some changes you're not happy with.
You accepted them but you wanna revert them now.
Well, maybe you can use good old command C,
undo your changes. You can undo them step by step, I
guess. Or if you're using some version control
like Git, you could go back to a previous commit.
But let's say neither of these things is an option because there have been
a couple of days in between and you did not create a commit before
you made some changes. What can you do?
Well, you could ask the AI, undo these changes, but that would be a
bad idea. It would be a bad idea because it costs
tokens. Every request costs tokens.
Not just the tokens for your question, but also the tokens for your
entire code that's submitted to the AI and the tokens, the
tokens that describe the changes that need to be made that are
produced by the AI. All of that counts against
your cursor usage limits. So that's not a good
idea. In addition, it's also not a good idea because it's AI.
It might not really go back to the state you had before because
it doesn't know that. But good news, Cursor got you
covered. This tiny button here, which you see on
every chat message you submitted in agent mode, takes you back to
the state of your code you had before you submitted
that question. So if you're not happy with the changes
based on your question, you can click this button,
confirm this that you want to continue and undo your changes, and
boom. You're back. That's the state we had
before. If you then decide that you actually were fine
with those changes, you can go back to them again by pressing
checkpoint. Again, continue, and you're back to the
changes that were made by the AI. So you can go back and forth
even if you don't have a commit and you can't
undo...