The virus can't "continue from where it left off" if there's nobody left in the country infected by it.
If it turns out there were a few infections left, or one slipped through quarantine for arriving travellers, the health system has enough capacity to perform testing for anyone with even mild symptoms, and comprehensively contact trace.
This has worked for several countries.