Johnny Tremain is set during the time of the Revolutionary War, in which America battles England for its independence. Pumpkin (his nickname based on his bright red hair) is a horse-boy for the British soldiers, and he comes to love the openness of America and wants to quit the British Army.
When Johnny is riding through the British camp and finds himself in some trouble, Pumpkin helps him break free. In exchange, Johnny arranges for Pumpkin to fulfill his dream. This young British citizen no longer wants to be part of the fighting; instead, he is entranced by the open space and farmland, something he did not experience back in England. Pumpkin's simple dream is to leave the army and go work on a farm, and Johnny arranges for him to do that--provided he let Johnny have his uniform.
The exchange is made, and Johnny gives the British uniform and musket to Rab. Shortly after, Johnny finds himself an unwilling witness to a hanging for treason. Pumpkin is hanged as an example to others who are contemplating desertion.
When the War has begun and Johnny must find a way to get to the battlefront to check on Rab, he remembers the uniform and wears it to get himself where he wants to be. The significance of Pumpkin's British uniform, then, is that it is instrumental in getting Johnny safely to the battle to be with his friend who eventually dies. What is hateful and unwanted to Pumpkin is that which saves Johnny's life.