Make sure you're including jQuery within the project.
The link that you want the user to click, trigger the scroll, needs to have a class of js-scroll-to-top
:
<a href="#" class="js-scroll-to-top">Back to Top</a>
At the top of your page, right after the body
tag, include an empty div with an ID of top
:
<div id="#top"></div>