In this work, we study the dynamic processes through which the scalar hair of the black holes is generated or detached. To this end, one investigates the temporal evolution of a far-from-equilibrium gravitational system in the framework of a theory featured by non-minimal couplings of a scalar field to the Gauss-Bonnet and Ricci scalar invariants. In our simulations, the initial spacetime is chosen to be either a bald Schwarzschild or a scalarized spherically symmetric black hole. By further introducing an energy injection, which might be perturbative in some cases, the system's evolution is explored. Intriguing features regarding the final fate of the system are observed, sensitively dependent on the initial configurations, perturbations, and the specific metric parameters. In particular, besides the well-known scalarization through which the black hole acquires scalar hair, the dynamic process might also serve to deprive the hair of an initially stable hairy one. Moreover, we elaborate on the temporal evolution of the scalar field, the metrics, and the Misner-Sharp mass of the spacetime. The implications of the present findings are also addressed.