To specify that part of a bookmap or ditamap should be treated differentially, you can insert a special PI marker to give that map section a “branch” name:
<?dtall branch="branchname" ?>
See §38. Working with processing instructions .
You do not need to specialize, or do anything else with the DITA code itself. When you place a branch PI marker in a map (not in topics), doing so marks everything in the map that comes after the PI marker, at the same level or below, as belonging to that branch.
You can override a branch PI with another branch PI marker, at the same level or below, following the same scoping rules (inheritance). DITA2Go manages branch PIs on a stack, so restore works as expected.