The importance of a strict quarantine has been widely debated during the COVID-19 epidemic even from the purely epidemiological point of view. One argument against strict lockdown measures is that once the strict quarantine is lifted, the epidemic comes back, and so the cumulative number of infected individuals during the entire epidemic will stay the same. We consider an SIR model on a network and follow the disease dynamics, modeling the phases of quarantine by changing the node degree distribution. We show that the system reaches different steady states based on the history: the outcome of the epidemic is path-dependent despite the same final node degree distribution. The results indicate that two-phase route to the final node degree distribution (a strict phase followed by a soft phase) are always better than one phase (the same soft one) unless all the individuals have the same number of connections at the end (the same degree); in the latter case, the overall number of infected is indeed history-independent. The modeling also suggests that the optimal procedure of lifting the quarantine consists of releasing nodes in the order of their degree - highest first.