A tragedy of the commons occurs when individuals take actions to maximize their payoffs even as their combined payoff is less than the global maximum had the players coordinated. The originating example is that of over-grazing of common pasture lands. In game theoretic treatments of this example there is rarely consideration of how individual behavior subsequently modiffes the commons and associated payoffs. Here, we generalize evolutionary game theory by proposing a class of replicator dynamics with feedback-evolving games in which environment-dependent payoffs and strategies coevolve. We apply our formulation to a system in which the payoffs favor unilateral defection and cooperation, given replete and depleted environments respectively. Using this approach we identify a new class of dynamics: an oscillatory tragedy of the commons in which the system cycles between deplete and replete environmental states and cooperation and defection behavior states. We generalize the approach to consider outcomes given all possible rational choices of individual behavior in the depleted state when defection is favored in the replete state. In so doing we find that incentivizing cooperation when others defect in the depleted state is necessary to avert the tragedy of the commons. In closing, we propose new directions for the study of control and influence in games in which individual actions exert a substantive effect on the environmental state.