fix(gatsby): scroll restoration issue in browser API (#27384)
fix(gatsby): scroll restoration issue in browser API (#27384)

* fix scroll restoration issue

* keep the behavior same

* fix the lint error
gatsbyjs/gatsby,gatsbyjs/gatsby,gatsbyjs/gatsby,gatsbyjs/gatsby,gatsbyjs/gatsby,gatsbyjs/gatsby