I edited \components\com_content\views\article\tmpl\default.php file to suit my needs, and to output a customized string instead of the default H1 header. The site was running all OK, but when I created a new menu item that I needed, using the backend admin interface, I lost the PHP file default.php modifications, and it got restored to it's initial values. Why did this happen ?
I have a hard time believing that the file was updated when creating a new menu item. It was more likely updated when updating Joomla. And that is expected. You should never modify core files, they will be overwritten when updating.
Instead you should create a copy of the template and then create layout overrides. There is plenty of documentation regarding this topic: