libgit2

git_revert

Version:

Reverts the given commit, producing changes in the index and working directory.

Signature

int git_revert(git_repository *repo, git_commit *commit, const git_revert_options *given_opts);

Parameters

In
repo

the repository to revert

In
commit

the commit to revert

In
given_opts

merge flags

Returns

int

zero on success, -1 on failure.

Versions