Is there a way to roll back a ChatGPT thread to a previous version?

I had a long thread going on ChatGPT. Today I accidentally edited a message that was dayssss old in the thread and it caused everything after it to be erased and started over with the new response.

Is there any way to get the old stuff back?

1 Like

I’m somewhat happy to find I’m not the only one but , kinda sad to see there is no solution yet. On my side I just lost months of work on a project. I don’t know what to do …

There is obviously a way, this cannot be left like this.

And I come back with a good news. There is effectively a way to get back your thread, or at least your text back.

By chance the support was really reactive and it helped me find a way around. They told that deleted thread where kept by them for around 30 days, which in my case why kinda bad since the part I lost on my thread got back to at least up to 7 or 8 months.

I discovered, around the old message that was modified that the one before was able to let you choose between two generation option (sometime chatgpt can generate an answer but not completely and by asking to regenerate it’s like creating a two way road starting from this generated message).

So I choose option 2 and it helped me get a lot of the thread back yet not everything (it helped me recover at least 3 months worth of work).

I was happy and sad at the same time because I got a part yet not everything back but after some reflexion , I remembered about the export your data option in the settings and decided to take a shot because why not after all.

And I was right because when your export your data, you get a zip file with a few JSON file, the one who your looking for is called conversation.json . It’s the one that hold all your threads.

It’s not perfect because all your messages are lost between lots of line of codes but at least you can get back your text.

If I found a workaround for the json to be more readable I will post it.

Edit : And I come back again with a way to work with the JSON file.

It might not be the most suitable option for everyone (there might be a more accessible option for everyone using PC but here I used Android.)

First, I converted the JSON file into an XML file.

Starting from here I used and app on the play store called “JSON and XML tool” which had an orange icon.

When I uploaded the file there it looked the picture I put to explain.

Each row is linked to a thread.



If your only looking for a specific thread you can remove the other by using the 3 dots on the right of the row and select remove as shown in the screenshots.

Once you have the row you looking for you can save it


With your saved file (I kept it in XML), you open it in another app called Code Editor

In this app you can see more clearly the info your looking and copy/cut - copy/paste on another app or txt file of your choice.

I know it might not be suitable for everyone but it’s the solution I found.

After getting a part of my thread back as I was explaining earlier, I discovered I was in fact really short on message left to be generated.

It can be a reason to why the thread took me back to the old message and modified it. I was conscious about the fact that the thread would not be eternal but don’t forget it might be a reason behind this possible bug.

You can try MyForest AI, it supports graph interaction, and you can see all your thread anytime. Looking up message in deep chain is tedious.

I hit the same issue as this. Using chatgpt itself we put together some simple python code to process the conversation.json and extract out what was needed

import json

def load_export_data(file_path):
    # Load the entire JSON file into memory
    print(f"Loading data from '{file_path}'...")
    with open(file_path, 'r', encoding='utf-8') as f:
        data = json.load(f)
    print("Data loaded successfully.")
    return data

def extract_messages(mapping):
    # Find the root node to start extracting messages in order
    print("Finding root node...")
    root = None
    for key, value in mapping.items():
        if value.get("parent") is None:
            root = key
            print(f"Root node found: {root}")
            break

    if root is None:
        print("Error: No root node found.")
        return []

    # Recursively gather messages in the correct order
    conversation = []

    def traverse(node_id):
        print(f"Traversing node: {node_id}")
        node = mapping.get(node_id)
        if not node:
            print(f"Warning: Node {node_id} not found in mapping.")
            return
        
        # Traverse children nodes even if the current node has no message
        children = node.get("children", [])
        if node.get("message"):
            message = node["message"]
            role = message.get("author", {}).get("role", "unknown")
            content_parts = message.get("content", {}).get("parts", [])

            for part in content_parts:
                conversation.append({"role": role, "content": part})
                print(f"Message added: [{role}] {part}")

        # Traverse children nodes in order
        if children:
            print(f"Node {node_id} has {len(children)} children: {children}")
        for child_id in children:
            traverse(child_id)

    # Start traversal from the root node
    print("Starting traversal from root node...")
    traverse(root)
    print("Traversal complete.")
    return conversation


def main():
    file_path = 'conversations.json'  # Replace with your exported file path
    
    data = load_export_data(file_path)
    conversation_data = data[0]  # Assuming we want to extract from the first conversation
    mapping = conversation_data.get("mapping", {})

    print("Extracting messages...")
    messages = extract_messages(mapping)

    # Print extracted messages
    print("\nExtracted Conversation:")
    for msg in messages:
        role = msg.get("role")
        content = msg.get("content")
        print(f"[{role}] {content}\n")

    # Optionally save extracted conversation to a separate file
    with open('extracted_conversation.txt', 'w', encoding='utf-8') as f:
        for msg in messages:
            f.write(f"[{msg['role']}] {msg['content']}\n")
    print("Extracted conversation saved to 'extracted_conversation.txt'.")

if __name__ == "__main__":
    main()