After my first attempt to move the shelves, I got the step stool and drill in preparation for re-attaching the shelves to the wall. I then discovered that I'd forgotten that the narrow shelf was supposed to be on the right -- I'd moved it to the left when we pulled everything out last month. That means the bracket doesn't line up in the right place. The bracket has to be where it was because there's no point in attaching the shelf only to the dry-wall -- in case of earthquake, the screw will simply pull out of the wall. You have to attach it to one of the wall studs using a long screw. So I had to rearrange the shelves to get the brackets on the small shelf to line up again.
For some reason, even after getting the first shelf in the right place, the second shelf's bracket still wouldn't line up properly. I had to detach it from the shelf and move it a couple of centimeters to the right and re-attach it to the shelf frame. I found this a little strange, as if the room had slightly changed dimensions since I detached the shelves last month.
Then I could move the tables and chairs back into the areas where they belong, and Cheryl moved things back into their proper place on the shelves. Finally we have the apartment back to the state it was in before the leaks started. Whew!