# Whats an example of the minimal code required to undo a transformation?

**URL:** <https://discuss.prosemirror.net/t/whats-an-example-of-the-minimal-code-required-to-undo-a-transformation/1536>\
**Category:** Uncategorized\
**Created:** [September 26, 2018, 2:42am UTC](https://discuss.prosemirror.net/t/whats-an-example-of-the-minimal-code-required-to-undo-a-transformation/1536 "2018-09-26T02:42:37Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![rich](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/rich/32/430_2.png) [@rich](https://discuss.prosemirror.net/u/rich)\
**Post date:** [September 26, 2018, 9:01am UTC](https://discuss.prosemirror.net/t/whats-an-example-of-the-minimal-code-required-to-undo-a-transformation/1536/3 "2018-09-26T09:01:35Z")

</div>

This is probably another use case for amending a transaction see this [recent discussion](https://discuss.prosemirror.net/t/amendtransaction/1532/3).

At the moment I’m just hijacking `filterTransaction` - you can either mutate the `tr` coming in here (although that’s not really supported) to reset it and pass the details form the un-reset `tr` through `setMeta` to your plugin state. Or you can actually filter the transaction and store the most recent transaction in your closure somewhere. Neither of these seem that nice, but they work for the most part …

---

_[View the full topic](https://discuss.prosemirror.net/t/whats-an-example-of-the-minimal-code-required-to-undo-a-transformation/1536)._
