I accidentally attached a script to a sprite instead of its parent Node2D object so I couldn't get access to the sprite node positions and such from that script. I know in the inspector that you can choose the script, set to none or such, but I ran into editor hell. In the filesystem I tried deleting the script, renaming it and reattaching it and lots of other stuff that didn't work out well. Even to the point that when I switched to the scripts tab I would get a new script created "GDScript" and a number. Eventually I deleted the entire tree and recreated it without errors to begin with. It was just a test project so that was no big deal at all. However if I had a large project that would be a very bad situation to say the least.
So, for a newbie, how do you properly rename or delete scripts?