The simplest advice is that you should never edit what are generally know as Core
WordPress files, that includes adding new files within the wp-includes and wp-admin directories.
The simple reason why this is not a good idea is that they are replaced when WordPres updates – deleting any changes or additional files – which I presume is the reason your files were also removed recently.
Instead, you should add changes to your own theme or a custom plugin – the theme is the easiest route in most cases, but again you should avoid to edit things you don’t control, so don’t edit a theme you have bought or downloaded, instead learn how to create a child theme which you can safely edit, knowing that your updates will not get lost.
Once you have your child theme – or custom plugin – you can add your code there – in a theme the easiest place is inside the functions.php file