Reference

Revert commit

Undoes one commit with a new commit that puts back what it changed.

POST
/namespaces/{namespace}/branches/{branch}/revert

The commit's paths return to how they were in its parent; for a merge, its first parent. If the branch changed any of those paths since, nothing is saved and the answer is 409.

Authorization

bearer
headerAuthorizationBearer <token>

Path Parameters

namespace*string

A namespace of your organization, such as prod/app, or <org>:<namespace> for a public namespace of another one. Encode / as %2F.

branch*string

A branch, such as main or agents/fix-1. Encode / as %2F.

Request Body

application/json
  1. body
commit*string

The commit to undo.

Match^[0-9a-f]{64}$
message?string
Length1 <= length <= 10000

Response Body

The commit changed nothing, so no commit was made.

application/json
  1. response
head*string

The branch's head after the call.

changed*boolean

False when every change matched what was already there. Then no commit is made and head is the current one.

Example Request
curl -X POST 'https://example.com/v1/namespaces/string/branches/string/revert' \  -H 'Content-Type: application/json' \  -d '{  "commit": "string"}'
Example Response
{  "head": "string",  "changed": true}