**Apache Airflow version**: 2.0.0

**Environment**:

- **Cloud provider or hardware configuration**: Docker container
- **OS** (e.g. from /etc/os-release): Debian Stretch

**What happened**:

When working on some custom DAG override logic, I noticed that invoking `DAG.partial_subset` does not properly update the corresponding `_task_group.used_group_ids` on the returned subset DAG, such that adding back a task which was excluded during the `partial_subset` operation fails.

**What you expected to happen**:

Tasks that had already been added to the original DAG can be added again to the subset DAG returned by `DAG.partial_subset`

**How to reproduce it**:
Create any DAG with a single task called, e.g. `my-task`, then invoke `dag.partial_subset(['not-my-task'], False, False)`

Note that the returned subset DAG's `_task_group.used_group_ids` still contains `my-task` even though it was not included in the subset DAG itself

**Anything else we need to know**:

I was able to work around this by adding logic to update the new partial subset DAG's `_task_group.used_group_ids` manually, but this should really be done as part of the `DAG.partial_subset` logic
airflow/models/dag.py
)
                else:
                    tis = tis.filter(TaskInstance.state.in_(state))
        tis = tis.order_by(TaskInstance.execution_date).all()
        return tis
    @property
    def roots(self) -> List[BaseOperator]:
        """Return nodes with no parents. These are first to execute and are called roots or root nodes."""
        return [task for task in self.tasks if not task.upstream_list]
    @property
    def leaves(self) -> List[BaseOperator]:
        """Return nodes with no children. These are last to execute and are called leaves or leaf nodes."""
        return [task for task in self.tasks if not task.downstream_list]
    def topological_sort(self, include_subdag_tasks: bool = False):
        """
        Sorts tasks in topographical order, such that a task comes after any of its
        upstream dependencies.
        Heavily inspired by:
        http://blog.jupo.org/2012/04/06/topological-sorting-acyclic-directed-graphs/
        :param include_subdag_tasks: whether to include tasks in subdags, default to False
        :return: list of tasks in topological order
        """
        from airflow.operators.subdag import SubDagOperator  
        
        graph_unsorted = OrderedDict((task.task_id, task) for task in self.tasks)
        graph_sorted = []  
        
        if len(self.tasks) == 0:
            return tuple(graph_sorted)