A similar question was asked a few weeks ago, and the answers pointed to using the built in Breadcrumb building blocks.
https://forum.mendix.com/link/questions/110089
If you are using breadcrumbs, the route through your application should be linear, so you should know what page you are currently on, and what the previous page was. How you chose to open the previous page is up to you. For example, you may want to to just “Show Page”, but you may want to call a microflow or nanoflow first to reset some data before showing the page.
Hope this helps.