Stimuli-responsive shape-transforming hydrogels have shown great potential toward various engineering applications including soft robotics and microfluidics. Despite significant progress in designing hydrogels with ever more sophisticated shape-morphing behaviors, an ultimate goal yet to be fulfilled is programmable reversible shape transformation. It is reported here that transient structural anisotropy can be programmed into copolymer hydrogels of N-isopropylacrylamide and stearyl acrylate. Structural anisotropy arises from the deformed hydrophobic domains of the stearyl groups after thermomechanical programming, which serves as a template for the reversible globule-to-coil transition of the poly(N-isopropylacrylamide) chains. The structural anisotropy is transient and can be erased upon cooling. This allows repeated programming for reversible shape transformation, an unknown feature for the current hydrogels. The programmable reversible transformation is expected to greatly extend the technical scope for hydrogel-based devices.