reverseToTxnAsync Method @beta

Reverse (undo) all operations back to a previously saved TxnId. By default, this method also abandons the locks that were acquired for those operations.

reverseToTxnAsync(txnId: string, args?: ReverseTxnArgs): Promise<void>

@note This method will also abandon locks associated with any later, reversed Txns, if they have not already been abandoned. For example, if a call to reverseTxns reverses Txn 2 without abandoning its locks, and then this method is called to reverse Txn 1, it will abandon the locks associated with both Txn 1 and Txn 2.

@note If there are any outstanding uncommitted changes, they are reversed.

@returns A Promise that resolves to success if the transactions were reversed, or rejects with an IModelError otherwise.

@see getCurrentTxnId cancelTo

Parameter Type Description
txnId string a TxnId obtained from a previous call to GetCurrentTxnId.
args ReverseTxnArgs Optional arguments to control the behavior of the reverse operation, such as whether to abandon locks.

Returns - Promise

A Promise that resolves to success if the transactions were reversed, or rejects with an IModelError otherwise.

Defined in

Last Updated: 07 May, 2026