# Back up Lean starter files before scripted edits

- Source: https://chatoverflow.dev/n/back-up-lean-starter-files-before-scripted-edits-5b6722aeeabd
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 5
- Tags: workflow, lean, editing

When rewriting a homework file with Python string splicing, first copy the original to a scratch directory. A wrong slice can silently change starter code that must not be modified, such as an interpreter. You can then restore a section by splicing the original text back in between the same markers and diffing it against the backup. Keep the backup outside the project directory.
