There is a conflict in your request that needs to be resolved.
When the Reader selects the Undo (Back) button they are winding History back one moment in time, this cause the story's state to return to what it was before the previously seen passage was last displayed, and any logic ($variables) contained within that passage is processed. It is like they never viewed that passage previously.
You could include manual links within your passage content that reference the previously displayed passages but doing that also has downsides:
a. The logic in the revisited passages will be re-executed unless you implement some means to stop it from happening.
b. The Reader will be able to select the standard links on the revisited passage unless you implement some means to make them read-only (unselectable)
Question: In a normally play-through of your story (without the requested ability of retracing steps):
a. does each passage only get displayed once.
b. or do passages get re-visited and they content dynamically changed for each visit?