Revert a merged changeset
POST /Platform/entities/changesets/{changeset_id}/revert
Revert a merged changeset. Undoes a merged (or partially merged) changeset, recorded as a NEW changeset.
Members that existed on the target branch before the merge are restored to their prior head (a new restore commit — never history rewriting); members that were NEW to the target branch have their branch pointer removed (commits stay in the entity table; nothing is hard-deleted). Only members actually written by the merge are touched.
Refuses if the target branch moved past the changeset's commits
(someone edited an entity after the merge) and reports the moved
members; force=true overrides for the whole changeset.
Path parameters
changeset_id: str. The merged/partially_merged changeset to revert.
Body parameters
force: optional bool. Clobber later edits on moved members instead of refusing.
Returns
ChangesetResponse
changeset: dict. changeset_id, from_branch, to_branch, status, description, author, origin_ref, approver, resolutions, plan, code_ranges (one per repository: repo_id, repo_name, base_sha, head_sha, to_sha, merged_sha), created_at, merged_at, members (entity members and, as RepoFile members, the files each code range changes), events, test_evidence.auto_approve_ignored: optional str or null. Why auto_approve was ignored (main is protected and the caller holds no bypass).
Example request
curl -X POST "https://api.hilus.ai/Platform/entities/changesets/{changeset_id}/revert" \
-H "Authorization: Bearer $HILUS_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'