code: def _generate_reversed_sql(self, keys, changed_keys):
          
          for key in keys:
              if key not in changed_keys:
                  continue
              app_label, sql_name = key
              old_item = self.from_sql_graph.nodes[key]
              new_item = self.to_sql_graph.nodes[key]
              if not old_item.reverse_sql or old_item.reverse_sql == RunSQL.noop or new_item.replace:
                  continue
  
              # migrate backwards
              operation = ReverseAlterSQL(sql_name, old_item.reverse_sql, reverse_sql=old_item.sql)
              sql_deps = [n.key for n in self.from_sql_graph.node_map[key].children]
              sql_deps.append(key)
              self.add_sql_operation(app_label, sql_name, operation, sql_deps)
docs: Generate reversed operations for changes, that require full rollback and creation.