I am working on a docs site created from the gatsby starter gatsby-starter-rocket-docs. I want to have a different image from the default as the header to the sidebar. Currently, the image comes from an svg defined in the node modules, rather than in the code itself for the repository. The node modules aren't persisted, so the changes can't be made there. I need to override the styling defined in the node modules (which are installed in the folder via npm install gatsby), but I need to do it from the code that is persisted.
Here is the image I'm trying to replace:
This issue is defined in greater detail here, and here is the repository containing all the code. The issue also mentions changing the colors of highlighted links in the sidebar, and this should have a similar fix because the highlight color for that is also defined in the node modules. However, the image is the more important issue.

When you deal with Gatsby Themes you need to make an extra effort to override the default configuration settings in the core of the theme, as you said. Gatsby allows you to make it using a concept known as "shadowing". Basically is a custom configuration (from logos to CSS, etc) that overrides the default one. From their documentation:
You need to recreate the theme structure (inspect it in the
node_modules) with your own components, assets and styles. For example, given that structure:To add a custom
bio-content.jscomponent you'll need to add a file calledbio-content.jsunder/src/gatsby-theme-blog/components/bio.js, and so on for the rest of the custom components.