---
title: "Undo a changeset"
description: "Replay a bundle's operations in reverse through the normal permission compiler; undoing a delete recreates the row only if you could create it."
canonical: "https://grid82.com/docs/builder-api/changesets/revert"
updated: "2026-11-13"
---

# Undo a changeset

`POST https://studio.grid82.app/v1/apps/{appId}/changesets/{changesetId}/revert`

Replay a bundle's operations in reverse through the normal permission compiler; undoing a delete recreates the row only if you could create it.

Updates restore only changed fields, preserving edits to other fields; if someone changed the same fields, refuse and identify them unless `confirm: true`, which overwrites their changes. Record the revert so reverting it undoes it. Only bundles of record creates, edits, and deletes are revertible; the list marks each `revertible`. Refuse comments, saved views, pages, and app SHAPE changes up front with the reason: restoring a definition would run its migration in reverse, and a returning column loses its contents. Restore deleted fields or tables, and columns converted by a type change, from the trash with `trash.restore`, including values. Undo all restorable rows in one transaction; list rows deleted since in `skipped` rather than failing the rest.

Requires the `records:write` scope. Operation `changesets.revert`. MCP tool `changesets_revert`. CLI: `grid82 changesets revert` (`npx grid82`).

## Path parameters

| Name          | Type   | Required | Description |
| ------------- | ------ | -------- | ----------- |
| `appId`       | string | yes      |             |
| `changesetId` | string | yes      |             |

## Headers

| Name              | Type   | Required | Description                                                                                                                                                                                                                                                        |
| ----------------- | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `Idempotency-Key` | string | no       | Any unique string. Sending the same key with the same request again returns the first response (marked `Idempotency-Replayed: true`) instead of running it twice. Reusing it for a different request is refused with 409. Kept for 24 hours. Up to 255 characters. |

## Request body

| Field     | Type    | Required | Description |
| --------- | ------- | -------- | ----------- |
| `confirm` | boolean | no       |             |

**Authorizations**

- `Authorization` (bearer, in header, required)

## Response

**200**: Success

- `data` (`object`, required)
- `data.id` (`string`, required)
- `data.status` (`string`, required)
- `data.skipped` (`object[]`)
- `data.skipped.tableId` (`string`, required)
- `data.skipped.recordId` (`string`, required)
- `data.skipped.reason` (`string`, required)

```json
{
  "data": {
    "id": "<string>",
    "status": "<string>",
    "skipped": [
      {
        "tableId": "<string>",
        "recordId": "<string>",
        "reason": "<string>"
      }
    ]
  }
}
```

**4XX**: Refused

- `error` (`object`, required)
- `error.code` (`enum<string>`, required, one of: `not_found, forbidden, unauthenticated, validation_failed, conflict, rate_limited, payment_required, not_implemented, internal`)
- `error.message` (`string`, required)
- `error.details` (`Record<string, unknown>`)

```json
{
  "error": {
    "code": "not_found",
    "message": "<string>",
    "details": {}
  }
}
```

**Example request**

```bash
curl --request POST \
  --url 'https://studio.grid82.app/v1/apps/<appId>/changesets/<changesetId>/revert' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "confirm": true
}'
```
