I have this as well. I get severe muscle aches after heavy exercise, followed by a migraine. What has helped me personally is realizing that this is TMS--and it's important to not catastrophize it (there is nothing wrong with you, your brain is just being overprotective!) Personally, my brain seems to interpret any stress that I experience (whether physical or mental, it doesn't matter) as a lion attack plus an alien invasion and a category 5 hurricane...in other words, it freaks out. Perhaps your body/brain is similar.
I'm still working on this but a few things that have worked for me personally are: I don't stop exercising, but I try not to overdo it. I keep increasing the amount of exercise that I do slowly and gradually. I tell myself that I am completely fine and I do the TMS practices that you'll find on this site. I especially try to practice stress reduction and be gentle with myself and stop any negative self-talk.
I love exercise so sometimes I do overdo it, in which case I let myself take an advil preventatively--because I'm not completely healed from TMS yet I think it's ok to bridge the gap with whatever works at this point. And I do find that it helps, but of course you want to be careful with it and not use it too frequently.
I also have to let all expectations drop--I have a general weekly plan for running, but if I wake up and don't feel good, I don't push through it and I don't feel bad about taking a day off. You have to really listen to your body, and you have to accept those days when you just shouldn't be pushing it. This can be difficult but once you become more attuned to your needs, your body/mind will feel safer and less reactive. I also tell myself that I'm taking a rest day to take care of myself, and I think it's important to send that message to your brain--that you are paying attention to your needs, that you can be trusted to keep yourself safe and cared for.
I am not healed yet but I'm a lot better, so I know that the TMS practices work, and I'm also confident that eventually I'll be 100% healed, and you can be too. Good luck!