Could you describe the changes you want to make in more detail?
Discourse team and the architects of Ruby & Rails (etc.) have gone a long way to make sure you can change code in plugins.
The whole point of plugins and theme components is that their changes survive rebuilds of the container.
Start here if you code changes includes Ruby API: Developing Discourse Plugins - Part 1 - Create a basic plugin
If Javascript only you can usually get away with a Theme Component. Beginner's guide to developing Discourse Themes