> For the complete documentation index, see [llms.txt](https://rxjs.gitbook.io/rx-txjs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://rxjs.gitbook.io/rx-txjs/job-api/txjob-undos.md).

# TxJob::undo

Run undo sequence on previous execute / continue. The **undo** send undo message to each already executed component in forward or backward order.

The component register on the undo message as:

```
this.mountpoint.undo().subscribe(
  (task) => {
    logger.info('[C2Component:undo] got task = ' + JSON.stringify(task, undefined, 2));
    this.method = task['method'];
 
    // just send the reply to whom is 'setting' on this reply subject
    this.mountpoint.reply().next(new TxTask('undo from C2', 'ok', task['data']))
  }
)
```

For example if the chain including C1, C2, C3. After the execution, calling to undo with backward order will initiate a sequence of undo call to each component in reverse order, C3, C2, C1.

**usage**

```
let job = new TxJob(); // or create througth the TxJobRegistry
 
job.add(TxMountPointRegistry.instance.get('GITHUB::GIST::C1'));
job.add(TxMountPointRegistry.instance.get('GITHUB::GIST::C2'));
job.add(TxMountPointRegistry.instance.get('GITHUB::GIST::C3'));
 
job.execute(new TxTask(
  'create',
  '',
  {something: 'more data here'})
);        
 
job.undo(backword);
```
