You see Marty inside Baron Hats. Marty came in with a hat on his head and had several spec hats he had brought to the store for sizing. You see THE HAT he allegedly stole (worth $500) sitting on the counter (red arrow). Marty puts the hat he was wearing, along with a piece of paper, on top of THE HAT.
A short time later, Marty returns to the counter to speak with the clerk and grabs the spec hats. That's when Marty makes his move. He picks up the hat he wore into the store. Then he puts the spec hats on top of THE HAT and beats a hasty retreat -- so quickly, he forgets his cane.