You need to store in a variable your desired default max walk speed for when you change it, have something to go back to.
In step 8 of the tutorial they change the variable on press and change it back on release.
This can also be set max walk speed to you sprint speed variable and when not sprinting set it back to your store max walk speed. For example:
Believe it’s MaxWalkSpeed in the 1st Person Template:
Drag from the Character Movement component: