How to return back to previous page when pressing the reset button?