If you want to protect your country invest in nukes.
Maybe you meant invest in nuclear weapons.
Nukes are useless in defense: the cannot be used anyway.
And yeah, maybe the defending countries leader isn’t willing to end it all, and maybe try collaboration or partisan resistance. But if you were the attacking country, would you be willing to make that bet? Or would you hesitate?
https://en.wikipedia.org/wiki/Fulda_Gap
In reality this escalates very fast into all out nuclear war. Which is why you don't see wars between two nuclear armed countries. There is no winner in a nuclear war.