Revert the given commit, producing changes in the index and working directory. This operation updates the repository's state and prepared message (MERGE_MSG).
(self, commit: Commit)
| 1599 | check_error(err) |
| 1600 | |
| 1601 | def revert(self, commit: Commit) -> None: |
| 1602 | """ |
| 1603 | Revert the given commit, producing changes in the index and working |
| 1604 | directory. |
| 1605 | |
| 1606 | This operation updates the repository's state and prepared message |
| 1607 | (MERGE_MSG). |
| 1608 | """ |
| 1609 | commit_ptr = ffi.new('git_commit **') |
| 1610 | ffi.buffer(commit_ptr)[:] = commit._pointer[:] |
| 1611 | err = C.git_revert(self._repo, commit_ptr[0], ffi.NULL) |
| 1612 | check_error(err) |
| 1613 | |
| 1614 | def revert_commit( |
| 1615 | self, revert_commit: Commit, our_commit: Commit, mainline: int = 0 |