Follower recovery can be done using https://hist.nostr.land
As for how to prevent it happening in the first place, the main thing to do is only follow/unfollow people from ONE client, and don't completely change all your relays. When using a different client, before you follow someone, make sure your relays match the client where you are usually following/unfollowing people.