ek9_git_revert

Reports newSha, revertedSha, previousSha, branch, subject, changedFiles and changedFileCount; a conflicting revert aborts with the tree restored.

Category: Execution · Compare: git revert / Revert Commit

When to use it

'Undo that commit safely' - one call with ref (a sha, HEAD, a tag); records a NEW inverse commit, so it is safe on already-pushed history. For a merge commit add mainline (the parent to keep, usually 1).

When not to use it

Details

ref is verified first (rev-parse) so an unknown ref is refused before any mutation (ref-not-found, with ek9_git_log as the route); a merge commit without mainline is refused (mainline-required), mainline on a non-merge likewise. A revert that hits conflicts is aborted with treeRestored:true - never a half-done state. Shas are the 8-hex short form shared across the family.

Arguments

ArgumentTypeRequiredWhat it is
mainlineintegerFor a merge commit only: the parent number to keep (usually 1). Omit for an ordinary commit.
refstringyesThe commit to revert - a short or full sha, HEAD, a tag or any ref.