The “#” or the “Collapse All” button above the structure allows you to fold the entire structure (to switch from the first to the second screenshot).
But it is unable to reverse that using the same button and go back to the unfolded structure as in the first screenshot.