When Roy and Alkali climb into the hatch of the boat to hide, Roy is on the left and they both have their hats on. In the close-ups of them listening to the sheriff's conversation with Billie, they have switched places in the hatch and their hats are off. When they climb out after the sheriff leaves they are back in their original places and their hats are on.
Immediately after the scene in which Bob's hat is crushed, there is a close-up of Roy in which we catch a glimpse of Bob in the background wearing a perfectly unspoiled hat. Shortly afterward when everyone runs into the hacienda after hearing the shot, his hat is still as good as new.