There really is only two solutions: to comb it out or to shave it off...
If you're really against shaving it off, then I'd suggest that you use some detangler/leave-in conditioner to slowly comb/brush out the knots. It's really up to you to get her used to being combed/brushed and be this daily. Start slowly and gently - try not to scare her. Use brushes that don't hurt when you use it over your own skin. Give her lots of treats during and after.
If her hair is matted beyond control, then I guess you have no choice but to shave it off. Then, I'd highly suggest you brush her daily from then onward. At only 4 months old, she's more likely to become accustomed to this routine than when she gets older. Otherwise...be prepared to be getting her shaved often!