My AI broke my site, how do I go back
Do not ask the AI to fix it. Go back to the last version that worked first, then look at what changed. If your project is under version control, one command undoes everything. If not, your backup is the only way out, and you need to set up tracking right now.
The instinct that makes it worse
The site worked. You asked for a small change. Nothing displays any more.
The natural instinct is to tell the AI “it is broken, fix it”. That is the worst possible sequence, for one simple reason: it does not remember the previous state. So it rebuilds, from memory, something resembling what you had. You end up with a third version, neither the original nor the broken one, and the problem becomes impossible to locate.
Do not repair. Go back.
In order
1. Stop changing things. Every extra change moves you further from the state that worked. Close it, breathe.
2. Return to the last working version. If your project is under version control, that is one command and it is instant. You get back exactly what you had, down to the comma.
3. Look at what had changed. Once you are back on safe ground, you can compare the two versions calmly and see the exact lines that broke.
4. Ask for the change again, differently. This time, ask for the plan before the execution.
If you have none of that
If your project is under no version control at all, there is no elegant answer. Your most recent backup is the only way out, and if it is three weeks old, you lose three weeks.
That is the situation nobody wants to be in, and it is the situation most beginners are in.
Set up version tracking before you resume work. Not after, not next week. It is thirty minutes once, and it turns every future disaster into a single command.
How to make this impossible
Three lines in your instruction file change the picture:
Do not rewrite working code to make it cleaner, unless I explicitly ask.
Do what I asked, nothing more. If you spot another problem, flag it in one line and carry on with the current task.
Before changing more than one file, show me the plan and wait for my go-ahead.
The third is the most effective. A five-line plan lets you see an unrequested change coming, before it is applied.
What stays true
A written instruction can be ignored. Rarely, but it happens.
That is why version control is not optional. The instruction lowers how often accidents happen. The backup decides what happens on the day one happens anyway.
Frequently asked questions
- I have no version control, what now?
- Your most recent backup is your only option. Restore it, then set up version tracking before you resume work. Until that is done, every working session is a gamble.
- Can I just ask the AI to undo what it did?
- Bad idea in most cases. It does not reliably remember the previous state, so it rebuilds from memory something that resembles the original without being it. You have added a layer to the problem.
- How do I find out exactly what broke?
- Compare the working version and the broken one file by file. Version control does that in one command and shows you only the lines that changed.
Sources
- Git documentation — undoing things — accessed