The return of the “A” on the storage container in which Rick was trapped by Jadis and the Scavengers could be a sign of Rick’s brain sparking back to when the folks at Terminus trapped him and his pals in a train car marked A. Admittedly, he wasn’t naked at Terminus, but assuming Daryl told him what he endured while being tortured at the Sanctuary, his brain may have just added the nakedness.
His current state of undress in the storage contain may be a combination of the Terminus train car and Daryl’s torture stories.
A dream would explain some things that haven’t made a whole lot of sense lately.
For one thing, there have been some elements of Season 8 that feel too specifically familiar to simply be recycled because the writers thought they worked.