Editing the Discourse source code isn’t the recommended way to make changes to Discourse. I think you are going to have to find a way to make the change in a plugin.
What happened when you restarted Discourse will depend on how you restarted it. If you ran ./launcher rebuild app, then the changes you made will have been overwritten from the Discourse base image. If you ran ./launcher start app, it may be that starting the app isn’t enough to get Discourse to recompile the edited handlebars template.
Do you really need to prevent moderators and admins from viewing user’s IP addresses? There are a few requests on this site to add a setting that prevents moderators from viewing IP address. I’m not aware of other sites wanting to prevent admins from viewing IP addresses.