def METHOD_NAME(project):
    commit = project.commits.list()[0]
    revert_commit = commit.revert(branch="main")
    expected_message = f'Revert "{commit.message}"\n\nThis reverts commit {commit.id}'
    assert revert_commit["message"] == expected_message
    with pytest.raises(gitlab.GitlabRevertError):
        # Two revert attempts should raise GitlabRevertError
        commit.revert(branch="main")