If the building is a lost cause or there are a lot of damages, then there isn't really much of a choice but to demolish it. However, if the building is still has good foundation and has only little defects, then maybe you could just renovate it. It really depends on the state of the building and your preference.