libgit2

git_revert_commit

Version:

Reverts the given commit against the given "our" commit, producing an index that reflects the result of the revert.

The returned index must be freed explicitly with git_index_free.

Signature

int git_revert_commit(git_index **out, git_repository *repo, git_commit *revert_commit, git_commit *our_commit, unsigned int mainline, const git_merge_options *merge_options);

Parameters

In
out

pointer to store the index result in

In
repo

the repository that contains the given commits

In
revert_commit

the commit to revert

In
our_commit

the commit to revert against (eg, HEAD)

unsigned int
In
mainline

the parent of the revert commit, if it is a merge

In
merge_options

the merge options (or null for defaults)

Returns

int

zero on success, -1 on failure.

Versions