Cursor use Git to revert your work w/o confirmation

Coursor has access to Git and can wipe out your work.

Today, while evaluating an idea and after the idea is failed, I asked to revert Coursor that evaluation back to previous state.

Instead of reverting to previous state, Coursor decided to execute “git restore .“

Wiped out 3 days of my work.

I started working on a feature on Friday night, burned lots of tokens and did not commit the code because the code was incomplete.

Dear developers of Cursor, please don’t give your baby a nuke (auto-access to git).
This is a mass destruction feature
.

pretty sure, you have to allow cursor access to execute command lines automatically. it wont do that as standard option. deactivate this option again:

also, a nice reminder to use git as its supposed to be (if you already allow cursor to execute via command line).

Yes, I enabled auto-run, allowing Cursor to work with files and execute commands.

But there is a difference between:

  • executing command with ability to rollback, which Cursor has as a standard functionality,
  • and reverting a branch and wiping out without ability to restore.

Irrevertible changes are absolutely unacceptable.
Branch had work that I did outside of Coursor, in Visual Studio, and it wiped out everything.

I don’t want to victim blame you but you could have had a disk failure in those 3 days too and lost more than just your non-commits.

Git has stash and branches exactly for this reason - so you can be non-commit to Main but still milestone your work.

There’s been so many of these stories that making a branch and committing on Save should be part of the workflow.

1 Like

Git has stash and branches exactly for this reason - so you can be non-commit to Main but still milestone your work.

Thank you for sharing, but I’m not about version control best practices.

I am about a feature that can be dangerous: Cursor makes irreversible decisions.

Cursor makes irreversible decisions.

of course. prepare accordingly

1 Like

I think it’s important to acknowledge that LLMs can behave unpredictably, and depending on the context/training/data they can behave strangely. It is not safe to allow them to use all command-line tools automatically, and cursor warns you about then when you enable it?

If you need to allow it to use command line automatically (and I do this too), then you should ensure you whitelist/blacklist commands.

You are in charge, as the developer. It’s your job to make sure you manage your backups, and your environment. If you didn’t feel any twinge of concern over allowing it to auto-execute commands, then I urge you to look into prompt hijack attacks.