The long boom holding the panels can be retracted (the term used instead of "folding").
It is not done lightly, for fear of not being able to reverse it. It has only been done a few times, once when a truss (the P6 truss) was relocated, and once to work out an issue. During the extension of the boom during the relocation task, the panels tore, requiring an EVA to repair - another reason retraction is not done unless absolutely necessary.
Note: the P6 arrays were retracted long before the relocation, as the outboard arrays were installed. See the last video in this answer.
Here's an animation of the relocation plans. The arrays are already retracted at the beginning, but it does show the extension at the end.
Here's a real video of that later event, to work out the issue.
Supplementary information: the P6 truss had to be relocated because it was launched early in the ISS assembly sequence to provide power for the proto-ISS. It was attached to the Z1 truss near the center of the station. Much later in the assembly, after the other solar arrays were launched and attached, the P6 truss was relocated to its final resting place at the end of the port truss. Here's a picture of the proto-ISS showing the original placement of the P6 truss.

This video shows the whole assembly. The P6 array retractions are at 0:47 and 0:53. The relocation is at 1:03. The last Russian module added in this video is the long-delayed Nauka module, it has not actually been launched yet.