NYC came back because the mayor imposed some draconian laws - laws that would not be palatable in San Francisco.
> The contribution of such deterrence measures (the "stick") offers more explanation for the decline in New York City crime than the improvement in the economy, the authors conclude.
https://www.nber.org/digest/jan03/what-reduced-crime-new-yor...