"Revert" Button Option on past Code Blocks

After a code block has been added to a file, what if there was a new button present on the code block called ‘rewind’ or ‘revert’ that when clicked, reverted the file back to the code that was present in this file when that specific message was sent.

Meaning, if I had a python file which printed a “hello world” statement and i asked cursor to add an if else statement to the file. Then, imagine the conversation goes on for a few more messages and I decide that I’d like to go back to how the file was when it was just the “hello world” statement. it’d be nice if I were able to click on a “revert” button on the first cursor response code block which made the if else statement and have my original hello world file restored to how it was before all of this new code was added from the conversation.

the different ways of implementing this in my mind, would be adding “undo” functions that undoes the latest change based on the amount of code blocks that were added to that specific file since the code block for which the “revert” button was clicked. The other option would be to have cursor generate branches of the working directory constantly, with each change.

Neither are easy, and there may be a better way, but this feature would be very beneficial to me and likely others in the future.

1 Like