Lost 2000 lines of code because Cursor killed my file and rolling back via checkpoints does not work

As the title said, cursor reduced my file to 0 bytes, I was building into this file for a few hours and didn’t commit to git as I assumed that checkpoints worked.

Turns out they don’t.

1 Like

Hey, you can restore a file from the timeline, it records all file changes. It’s located at the bottom in the Explorer.

No file should ever be that long though, but that doesnt help you with this one. Git is also quite reliably.

if you happen to switch between intellij and cursor like i do, there’s a project history in intellij if you right click the project root folder.
if not, maybe cursor has something similar. all the best

Dear cursor team, you have a critical bug that can lead to the loss of all projects. People that work solo and rely on checkpoints may decide thay do not need git.
Steps to reproduce:

  1. The agent decides to move all app code to {authentificated} using CLI. Something breaks.
  2. The user restores the previous checkpoint. Moved files are deleted and not restored in the old location.
  3. User has no files and can’t even use timeline as it is available only for files he has opened.
    Any ideas on how to fix it?

Very bad idea.

2 Likes

Yes, bad idea, but cursor makes you feel like you have automated Git, and you can restore every change back to weeks of work.
Any ideas how to restore all files?

The VSCode (or VSCodium) Timeline (under the File Explorer sidebar) can still restore a file even if it’s been moved and no longer exists at its current location: Create a new, blank file it the location it should exist, named exactly the same as it was before, and then open the timeline. The timeline history will then reappear. I did a full test of this just to be sure. Just make sure the filter selection includes “Local History”. Select the last change and apply.


As to the larger issue of checkpoints making a user feel they have “automated Git” - that is most certainly not what that is for (at least, I’ve never thought of it that way, ever). It’s for being able to quickly iterate over an AI chat or composer session, and help steer the conversation in the right direction if the AI gets lost. I would never use it as a replacement for Git by any means.

2 Likes

Well, you should not feel that way.

thanks that worked for files restored from composer history (reply change to file), didn’t work if tried to recreate file from missing imports but most likely to missing extentions (if you Command + click) on the imported module it will try to open file and gives the button to create it, bit it creates file without extension so Timeline will be empty.

1 Like

sometimes cursor deletes even unrelated files that we never even touched like .git
This makes the IDE unusable.