Nothing in this chapter shall prevent the restoration of a nonconforming building partially destroyed by fire, explosion, act of God or act of public enemy, provided that any nonconforming building that is partially destroyed in the manner aforesaid may be reconstructed and thereafter used only in such manner as not to further violate the reasons for nonconformity. Any building that is nonconforming because of use that is totally destroyed in the manner aforesaid may be rebuilt only as a conforming use. Any building that is nonconforming because of height, area or yard requirements that is totally destroyed may be rebuilt only if the height, area or yard requirements of this chapter are met. To determine the extent of destruction for the purpose of this chapter, no part of the footings or foundation walls shall be considered. In the event that it is physically impossible to meet the height, area or yard requirements of this chapter, said building may be rebuilt, provided that the nonconforming height, area or yard requirements are not further violated.