Options
| Parameter | Type | Description |
|---|---|---|
targetBranch (TypeScript)target_branch (Python) | Required | Branch name (without refs/heads/) that receives the reset commit. |
targetCommitSha (TypeScript)target_commit_sha (Python) | Required | Commit SHA to reset the branch back to. Commits after this point are undone. |
author | Required | Provide name and email for the commit author. |
expectedHeadSha (TypeScript)expected_head_sha (Python) | Optional | Commit SHA that must match the current tip. Use to avoid races. |
commitMessage (TypeScript)commit_message (Python) | Optional | Custom message. Defaults to Reset <branch> to "<target subject>". |
committer | Optional | Provide name and email. If omitted, the author identity is reused. |
RefUpdateError when the backend rejects the reset (for example, the branch tip
changed).
Response
| Field | Type | Description |
|---|---|---|
commitSha (TypeScript)commit_sha (Python) | String | The SHA of the reset commit |
treeSha (TypeScript)tree_sha (Python) | String | The SHA of the commit’s tree object |
targetBranch (TypeScript)target_branch (Python) | String | The branch that received the reset |
packBytes (TypeScript)pack_bytes (Python) | Number | Size of the pack in bytes |
refUpdate (TypeScript)ref_update (Python) | Object | Contains branch, oldSha/old_sha (previous tip, 000000... if new), and newSha/new_sha (reset commit) |