At some point, you may want to reset the Fork and discard all transactions and state changes incurred from your simulations. We can do this by updating the “head” of the Fork. The head is a reference to a Simulation on top of which new Simulations are done. Effectively, it points to the last executed Simulation.
In this example, we’ll move where the head points, so we’re literally “removing” or “forgetting” transactions that had happened since that particular Simulation. In other words, we’re going back in time:
If you’re doing transactions on Tenderly by connecting your Web3 provider (ethers.js) to a Tenderly JSON-RPC provider, you can achieve the same by invoking evm_snapshot and evm_reset: