Note: the solution from -The student pressed the back button in the browser and lost all their code; what do I do?- mentions refreshing the page. This doesn't make sense here the Hatch Platform is dependent on an internet connection.
Sometimes WiFi will drop out at a school, sometimes a Hatch server error will be the cause, and students will occasionally lose many lines of code in a project they have open and active as a result. Once you have a connection back and steady, here are the steps you can take to recover their loss. This only applies to giving them the basic project code they lost, not any personal modifications, showcase work or challenge code.
1) Open an incognito window in chrome.
2) Login to the platform with your credentials.
3) Open the project your student lost with the url - https://hatchcoding.com/code/123456 - where 123456 is the unique digits for their project.
4) Use your magical powers to drag the project source code from each component into the work window.
5) Select and copy as much code as your student completed and maybe a little more to be nice.
6) Logout and close the incognito window.
7) Paste the code into your student's project. Fixed!
As a preventative measure during a disconnect of any kind during a class, ask any student who is currently working on a project to remain on that page. They should (ctrl-c) copy their current work as soon as a connection problem is noticed in the class. They should not attempt to refresh the page in their browser controls, save and close their project, or leave the page for any other on the site. They can continue to work on their code until the issue is resolved, just remind them to copy often so they can paste it back and save when there is a steady connection again. Students in any other part of the site will have to wait until the connection is restored.