Import overrides local changes in dependencies

I have two components, let’s call them Parent and Child. Both have been exported and then ejected. Now I need to make changes to the Child, so I import it. I make the changes and build it. Everything is fine. Now I need to make updates also to the Parent. The Parent depends on the Child. When I import the Parent it also re-imports the Child and overrides all the changes I have made to the Child.

The questions is: How to prevent importing dependencies?