Templates, partials and template variables are automatically stored as files since EE4. But they are also stored in the database (in the tables exp_global_variables, exp_templates, exp_snippets - note that the table-names still refer to the old identifiers from EE2: Snippets, Global Variables).
If you delete e.g. the file of a template variable via ftp the variable will be recreated (using the the according entry in the DB). So the right way is to delete the template variable via the Control Panel -> Templates.
I had a serious issue with a template variable that recreated itself infinitely because its name was too long (reported here on Github). This variable still is shown in the CP, in the DB and as file. I don't dare to delete it via the the CP because I fear that the infinite loop will run again.
How can I delete this template variable completely, safe and forever? I am thinking the best way would be deleting first the according entry in the database and then deleting the file via ftp.
Thanks for any contribution!