# Undo changes to an agent

> The agent history shows every change with person and time. Undo a single change or restore an earlier state of your agent.

Source: https://docs.qutee.ai/en/agenten/verlauf-und-wiederherstellen/

qutee records every change to an agent: who made it, when, and what changed. If someone overwrote a text or deleted an action by mistake, you get the old state back in a few clicks.

## Before you start

- You need the **Company Admin** role. With the **User** role you don't see the **Agents** area.
- The history lists changes from the agent editor, from [importing a file](https://docs.qutee.ai/en/agenten/agent-exportieren-importieren/), from the [website import](https://docs.qutee.ai/en/agenten/agent-aus-website-erstellen/), from [connected AI apps](https://docs.qutee.ai/en/integrationen/api-und-mcp/) and earlier restores.
- Undoing never changes whether the agent is active. You set that in the **Availability** tab with **Agent active**.

## Open the history

1. Open **Agents** and select the agent at the top.
2. To the right of the tabs, click the history icon (**Agent history**).

The **History** window lists the changes, newest first. For each entry you see:

- when it was changed,
- the kind of change, for example **Edit**, **Import**, **Website import**, **Edit through AI app**, **Restore** or **Undo**, and who made it,
- a badge when the change did not come from your team in the app: **Support**, **Connected app** or **System**,
- what was changed, for example "Changed: Maintenance request", and how many differences there are to the current state ("2 differences to now" or "Same as now").

If one person saves several times within two minutes, qutee combines that into one entry, for example "Edit (3 saves)".

## Undo a single change

This takes back only what happened in this one change. Everything changed after it stays.

1. In the **History**, click the entry. At the top it repeats what this change changed.
2. Choose **Undo only this change**.
3. The preview shows every affected place with **Before** (the value before the change) and **Now** (the current value). Untick anything that should stay.
4. Places that were changed again afterwards are listed under **Changed again later**, with person and date. They are not ticked. If you tick them, the later change is lost.
5. Click **Undo change**.

The app shows **Change undone. The data is being refreshed.** and reloads the page.

Older entries did not record what they changed. For them, **Undo only this change** is greyed out and you can only restore the state before.

## Restore the state before a change

This puts the agent back to how it was before an entry. Every later change goes too.

1. In the **History**, click the entry.
2. Choose **Restore the state before**.
3. The preview shows every difference with **Before** and **Now**. Badges say what happens: **Goes back** (a value goes back to "Before"), **Comes back** (an action deleted since is created again) or **Gets removed** (an action added later disappears). Untick anything that should stay as it is.
4. Click **Restore state**.

The app shows **State restored. Data will be refreshed.** and reloads the page.

> **Tip:** Before every undo and every restore, qutee saves the current state. That is also listed in the history afterwards and can be undone again.

### When something is not applied

Some values no longer exist, for example a voice that is no longer enabled for your company, a deleted email template, a deleted calendar or tag. qutee skips these values. The app names them in the message "Not applied because no longer available: …". Check these places by hand afterwards.

## When someone works on the agent at the same time

When two people work on the same agent at the same time, no input is lost:

- If the other person changed **other fields**, qutee saves your input and keeps their changes. Afterwards you see both.
- If they changed **the same fields**, the window **The agent has changed in the meantime** appears when you save. It shows **Currently saved** and **Your input** for each field, and who changed it when.

The window gives you three choices:

- **Save my input**: Your values overwrite the other person's. You can restore theirs from the history later.
- **Load current state**: The page shows the saved state. Your unsaved input is lost.
- **Cancel**: Nothing is saved, your input stays in the form.

This applies to the **Personality** and **Availability** tabs and to outbound agents. Changes from a connected AI app count too: the window then says "Changed through a connected app".

## Common problems

**"No entry yet. The first one is created with the next change to the agent."**: The agent hasn't been changed since the history was introduced.

**"The state before matches the current agent, so there is nothing to restore."**: Since this entry the agent has come back to the same state.

**The agent doesn't answer calls after a restore**: Restoring doesn't switch the agent on or off. Check the **Agent active** switch in the **Availability** tab.

## Next steps

- [Export and import an agent as a file](https://docs.qutee.ai/en/agenten/agent-exportieren-importieren/)
- [Check and test your agent](https://docs.qutee.ai/en/erste-schritte/agenten-pruefen-und-testen/)
