You can undo what you’ve just typed with cmd+z. We also have our Rewind feature, which you can open by clicking on the two left arrow icon next to Logs in the editor. That enables you to roll your project back to a prior date/time.
For backups you can save a zip file of your project or export to GitHub. Both are available under advanced options from the top-left project info menu in the editor.
The export options (download to zip or connect via git) are great, but they only cover the source code and not the asset files, which are stored in the Glitch CDN and dynamically referenced. Call me paranoid, but I want to back everything up just to be safe.
The easiest method I could come up with was the following script:
# Grab the .glitch-assets JSON file and extract the URLs
curl -s 'https://<id>.glitch.me/.glitch-assets' | jq -r ".url" > urls.txt
# Download each URL in turn
wget -i urls.txt
This will grab everything listed in the .glitch-assets file, which is basically everything in the virtual assets folder, including deleted files.
Replace <id> with the name of your Glitch. On Mac you might need to install jq, which I did with homebrew.