Rollback from prior chats

Since the Agent had begun nagging me about long chats, I began starting new ones. They’re much easier to use, but then I needed to roll back to a prior chat, and I’m kind of in trouble. Replit’s Agent is stuck; it cannot deal with this bug, and I don’t have a way of restoring my app.

Agent and Assistant both make git commits to version history for all changed.

Tip: put the instructions below into Assistant if you need additional support.

Mostly know that you can get your app to the correct state.

Click the “+” icon to open a new tab, type “shell” and open the command line. Type “git log” and press the down arrow to find a commit that looks like it was around the time you are looking to restore. Make note of the commit hash (i.e. a really long string of letters and numbers).

Type ‘q’ to exit git log.

Then type “git checkout 03a33djdjdj8483dddnjdjdjd20282727290000ddnsjo” (replace the commit string in this example with thr commit hash for the commit you want to roll back to”.

Run the server and test the app. If everything looks fine, in your shell tab type git reset —hard <commit hash> . (Please note: git reset dash dash hard). The forum is formatting the double dashes before hard into an emdash, so just be sure to type to dashes before the word hard.)

1 Like

Thank you!! That seems like the kind of thing someone who’s actually a software engineer could do easily though it seems overwhelming to me. But if it’s easy for a software engineer then it should be doable by the agent - hence my feature request! :sweat_smile:

I’ll save this in case I get into trouble again

1 Like

Okay, so there is an easier way.

Click on a new tab and open ‘git’. You’ll see a history of all the commits the agent has made. Just scroll down until you find one that looks like it will get you back to what you’re looking for.

Then, click on the link of the commit. You’ll see a button “restore all” and you’ll go back in time to how your app worked at that particular commit.

2 Likes