@bruh -- I have had changes seemly-disappear on me when I unintentionally caused a scene to have its own copy of some resource. I didn't notice that my changes in the editor were no longer changing my separate script etc file, then when I clear the set-script and go to re-attach: poof, nothing there.
The total way to prevent this problem or recover in the face of editor bugs is to use a version control system for even tiny/experimental projects. Never lose changes again, and always be able to back to any working version! Check out the Godot official Version Control Systems documentation, which links to the official plugin for git
, the most widely-used and open source version control system.