401.2 Compliance. The work shall not make the building less complying than it was before the repair was undertaken. Work on nondamaged components that is necessary for the required repair of damaged components shall be considered part of the repair and shall not be subject to requirements for alterations.
401.4 Demolition and replacement. Where a building or structure is effectively demolished by damage or where the intended method of repair is demolition and replacement, the replaced building, including its replaced foundation, shall comply with requirements for new construction in the International Building Code.
Existing foundations are permitted to remain and be reused where approved by the code official.