Resetting page when going back

Hi!

I’m wondering if there’s a way for pages to go back to its initial state when going back to that recently visited page?

Clarification: I’m on a page (1) and trigger an animation by clicking on a button. When I then go to another page on my site (2) and then go back to the first page (1) again, the animation appears as triggered. Basically, I want the page that I’m going back to to be “reseted”.

Video: Image 2022-08-31 kl. 16.38.29.mov - VEED

Thank you!