---
title: "revert"
method: POST
path: "/repositories/{repository}/branches/{branch}/revert"
tags: ["branches"]
---

# revert

`POST /repositories/{repository}/branches/{branch}/revert`

## Request body

- RevertCreation
  - `ref` string, required — the commit to revert, given by a ref
  - `commit_overrides` CommitOverrides
    - `message` string — replace the commit message
    - `metadata` object — replace the metadata of the commit
  - `parent_number` integer, required — when reverting a merge commit, the parent number (starting from 1) relative to which to perform the revert.
  - `force` boolean
  - `allow_empty` boolean — allow empty commit (revert without changes)

## Response `204`

revert successful

## Other responses

- `400` — Validation Error
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Resource Not Found
- `409` — Conflict Found
- `429` — too many requests
- `default` — Internal Server Error

---

[API](https://skmtc.net/treeverse/apis/lakefs-api.md) · [All operations](https://skmtc.net/treeverse/apis/lakefs-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/treeverse/lakefs-api/revisions/4617f80bee61/schema)
