Control of cellular plasticity during tissue remodeling in C. elegans