WEBVTT

00:00:00.380 --> 00:00:04.370
So you've been working with agent mode,
as we did here, but now

00:00:04.420 --> 00:00:07.580
you accepted some changes you're not happy
with.

00:00:07.600 --> 00:00:10.440
You accepted them
but you wanna revert them now.

00:00:10.520 --> 00:00:14.440
Well,
maybe you can use good old command C,

00:00:14.520 --> 00:00:17.510
undo your changes.
You can undo them step by step, I

00:00:17.620 --> 00:00:21.430
guess.
Or if you're using some version control

00:00:21.440 --> 00:00:23.690
like Git,
you could go back to a previous commit.

00:00:23.700 --> 00:00:27.690
But let's say neither of these things
is an option because there have been

00:00:27.720 --> 00:00:31.560
a couple of days in between
and you did not create a commit before

00:00:31.640 --> 00:00:33.700
you made some changes. What can you do?

00:00:33.740 --> 00:00:37.620
Well, you could ask the AI,
undo these changes, but that would be a

00:00:37.660 --> 00:00:41.160
bad idea.
It would be a bad idea because it costs

00:00:41.170 --> 00:00:44.230
tokens. Every request costs tokens.

00:00:44.230 --> 00:00:48.140
Not just the tokens for your question,
but also the tokens for your

00:00:48.160 --> 00:00:51.940
entire code that's submitted to the AI
and the tokens, the

00:00:52.280 --> 00:00:55.620
tokens that describe the changes
that need to be made that are

00:00:55.680 --> 00:00:59.540
produced by the AI. All of
that counts against

00:00:59.600 --> 00:01:03.020
your cursor usage limits.
So that's not a good

00:01:03.100 --> 00:01:06.460
idea. In addition,
it's also not a good idea because it's AI.

00:01:06.470 --> 00:01:10.440
It might not really go back to the state
you had before because

00:01:10.500 --> 00:01:14.340
it doesn't know that. But good news,
Cursor got you

00:01:14.420 --> 00:01:18.110
covered. This tiny button here,
which you see on

00:01:18.220 --> 00:01:22.200
every chat message you submitted in agent
mode, takes you back to

00:01:22.260 --> 00:01:26.250
the state of your code you had before you
submitted

00:01:26.250 --> 00:01:30.020
that question.
So if you're not happy with the changes

00:01:30.200 --> 00:01:33.800
based on your question,
you can click this button,

00:01:33.840 --> 00:01:37.300
confirm this that you want to continue
and undo your changes, and

00:01:37.320 --> 00:01:40.120
boom. You're back. That's the state we had

00:01:40.200 --> 00:01:44.160
before. If you then decide
that you actually were fine

00:01:44.200 --> 00:01:47.740
with those changes,
you can go back to them again by pressing

00:01:47.880 --> 00:01:51.500
checkpoint. Again, continue,
and you're back to the

00:01:51.540 --> 00:01:55.160
changes that were made by the AI.
So you can go back and forth

00:01:55.600 --> 00:01:57.940
even if you don't have a commit
and you can't

00:01:58.000 --> 00:02:00.620
undo...
