Opening nano with the `-B` flag (e.g. `nano -B file.txt`) creates a backup file `file.txt~` every time you save.