---
title: "Revert commit"
method: POST
path: "/api/projects/{projectId}/branches/{branchId}/revert"
tags: ["Branches"]
---

# Revert commit

`POST /api/projects/{projectId}/branches/{branchId}/revert`

Creates a new branch that reverts the project state to a specific commit.

## Path parameters

- `projectId` string, uuid, required
- `branchId` union, required
  - string, uuid
  - 'main'

## Request body

- object
  - `branchName` string, required — Name for the new revert branch
  - `commitId` string, uuid, required — ID of the commit to revert to
  - `message` string, required — Commit message for the revert

## Response `200`

The newly created revert branch

- object — The newly created revert branch
  - `id` string, uuid, required — Branch ID
  - `name` string, required — Branch name
  - `default` boolean, required — Whether this is the default (main) branch
  - `projectId` string, uuid, required — Project ID
  - `baseCommitId` string, uuid, nullable, required — Base commit ID
  - `createdById` string, uuid, nullable, required — ID of user who created the branch
  - `createdBy` object, nullable — User who created the branch
    - `id` string, uuid, required — User ID
    - `email` string, required — User email
    - `firstName` string, nullable, required — User first name
    - `lastName` string, nullable, required — User last name
  - `createdAt` string, date-time, required — Creation timestamp
  - `updatedAt` string, date-time, required — Last update timestamp
  - `changeRequests` object[] — Pending change requests
    - `id` string, uuid, required — Change request ID
    - `status` string, required — Change request status
    - `type` string, required — Change request type
    - `branchId` string, uuid, nullable, required — Associated branch ID
    - `projectId` string, uuid, required — Associated project ID
    - `createdAt` string, date-time, required — Creation timestamp

---

[API](https://skmtc.dev/gorules/apis/gorules-agent-api.md) · [All operations](https://skmtc.dev/gorules/apis/gorules-agent-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/gorules/gorules-agent-api/revisions/52c0773fcd80/schema)
