Ending pandemic restrictions too early could cause a second wave of disease