To help ensure you never lose work, Replit auto-saves your code as you write. If you ever lose an edit to your code that you'd like to recover, repl history is there to help.
A repl's history is located at
https://replit.com/@username/repltitle/history, but you can reach the same page by:
A repl's history will show the individual changes to a file, in order from most recent. Clicking "change file" next to the file name will bring up a prompt to select the desired file. Selecting a file with a particular time and date will reveal the code differences between that revision and the latest code.
To restore a previous revision of code, select the desired revision and click "Restore" in the top-right corner of the screen.
Here's a short gif demonstrating repl history in action: