am_rollback: Roll back pending operations

View source: R/document.R

am_rollbackR Documentation

Roll back pending operations

Description

Cancels all pending operations in the current transaction without committing them. This allows you to discard changes since the last commit.

Usage

am_rollback(doc)

Arguments

doc

An Automerge document

Value

The document doc (invisibly)

Examples

doc <- am_create()

am_put(doc, AM_ROOT, "key", "value")
# Changed my mind, discard the put
am_rollback(doc)

am_close(doc)


automerge documentation built on Feb. 5, 2026, 5:08 p.m.