I would suggest reading the following:
https://www.digi.com/support/knowledge-base/how-to-identify-and-recover-a-programmable-xbee
https://www.digi.com/support/knowledge-base/recovery-procedure-for-xbees