grgit-revert

Name

grgit-revert - Revert some existing commits

Synopsis

grgit.revert(commits: [<commit>, ...])
grgit.revert {
  commits = ['<commit>', ...]
}

Description

Given one or more existing commits, revert the changes that the related patches introduce, and record some new commits that record them. This requires your working tree to be clean (no modifications from the HEAD commit).

Note: git revert is used to record some new commits to reverse the effect of some earlier commits (often only a faulty one). If you want to throw away all uncommitted changes in your working directory, you should see grgit-reset, particularly the hard option. Take care with these alternatives as they will discard uncommitted changes in your working directory.

Returns a Commit representing the new HEAD.

Options

commits

(List<Object>, default: []]) Commits to revert. For a more complete list of ways to spell commit names, see grgit-resolve (specifically the toCommit method).

Examples

grgit.revert(commits: ['1234567', '1234568'])

See Also