properly undoable stmt.add_type_restriction. Closes #176469 [applied]