RVTDocs.com
Namespace: Autodesk.Revit.DB Class: SubTransaction

SubTransaction.RollBack

Method
Description:
Discards all changes made to the model during the sub-transaction.
Remarks:

The parent transaction (or a parent sub-transaction, if any) can still be committed, but the changes rolled back by this method will not be part of the committed transaction.

RollBack can be called only when all inner sub-transaction, if any, are finished, i.e. they were either committed or rolled back. If there is still a sub-transaction open, an attempt to roll this outer sub-transaction back will cause an exception.

Syntax
Exceptions
Exception Condition
InvalidOperationException A sub-transaction can only be active inside an open Transaction. -or- The sub-transaction's current status is not TransactionStatus.Started, therefore it may not be committed or rolled back.