Cloady Docs
API ReferenceEndpointsGit

Discard Git changes

Discard every change at the given paths: edited and deleted files go back to the last commit, and new files are deleted, staged or not. Paths are literal, never patterns. Fails before changing anything if a path has no change, and afterwards, naming what is left, if any of those paths still shows one. The discarded work can't be recovered. Works only on a development app: any other app answers 403 `read_only`. Runs git in the app's running container and returns its output.

POST
/api/workspaces/{workspaceSlug}/apps/{appSlug}/git/discard
AuthorizationBearer <token>

Personal API token (cldy_…)

In: header

Path Parameters

workspaceSlug*string
appSlug*string

Query Parameters

env?string

Value in

  • "production"
  • "preview"
  • "development"
region?string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/workspaces/string/apps/string/git/discard" \  -H "Content-Type: application/json" \  -d '{    "paths": [      "string"    ]  }'
{  "ok": true,  "output": "string"}