Farmers are reviving ancestral varieties and creating new ones that can withstand increasingly frequent storms, floods and droughts.