Blender Python erase whole Directory content
As well as the addons folder installed with blender you can have addons within blender's preferences folder. How to find the user config folder on each system is explained here.

Within the config folder for the current blender version, you can create a scripts/addons folder (which is where blender places scripts when you use the install from file button). Inside this addons folder, create and edit your addon. Your addon will show up in the addon list in preferences where you can enable/disable it after each change.

When you are happy with your edits, copy the addon to your backup folder. As the addon is edited in place you reduce the chance of erasing the wrong file and you can also remove/re-install blender without deleting your file.