Described are methods for reversible occlusion of a body lumen by way of degradation as a result of exposure to one or more stimuli such as light. The methods include administering one or more substance(s) into a body lumen of a subject and forming a stimuli-responsive polymer mass in the body lumen from the one or more substance(s). The mass is sufficient to occlude the body lumen in a manner that prevents transport of at least one material through the body lumen and is susceptible to on-command reversal in the body lumen upon exposure to one or more stimuli. The methods include administering one or more stimuli to a polymer mass in a body lumen for a time and intensity to cause the reverse the polymer mass. The methods are particular useful for applications in which it is desirable to temporarily occlude a body lumen, such as male and female contraception.