Hi Everyone,
I sorted out this.
when i restored apic1 to factory default, it lost connection with all the nodes in fabric as the new fabric is initialized on apic1. So, when the new setup script is run on apic , you need to reset leafs and spines as well. or else will have the old fabric settings and wont be discovered.
I have restored all the other leafs and spines to factory default ans they joined fabric along with apic2 and apic3.
now i can access apic2 and apic3 as well.