Those cases are refreshingly black and white. Yes and yes.
You deliver an ultimatum, wait for the invader to withdraw. If they call your bluff, you level them. Just a city at a time if they don't have nukes. Wholly if they do. I mean if your going to rely on a nuclear self defense, when someone attacks you, you have to be willing to use it.
What if the invaders are non-nuclear armed?
There is a wide range of responses between nothing and total nuclear annihilation, even without world police status.