Reproduction steps:
1. Download the attached tarball package "test.tgz" and import it into any project
2. In the Editor, open any of the imported package's scripts from the Project window
3. Edit the script and save changes to it
4. Return to Unity to recompile the scripts
5. Inspect the edited script again
Expected result: The script returns to its previous state
Actual result: The changes to the script are saved
Reproducible with: 2019.4.39f1, 2020.3.35f1, 2021.3.4f1, 2022.1.3f1, 2022.2.0a15