Whimsical: "Lost the rag". Origins and just what is "the rag" anyway?
Solution 1:
The Free Dictionary has some info on this:
lose one's rag: to lose one's temper suddenly.
[probably back formation from RAGGED, from Old English raggig ; related to Old Norse rögg tuft]
Solution 2:
The Oxford English Dictionary says to lose one's rag is a colloquial British phrase with a first quotation from Harry Lauder's Roamin' in the Gloamin' (1928):
Finally, losing his rag completely, he extended his fingers to his nose and challenged any three men in the audience to come up on the platform and fight him!
This is sense P4.b., and the related P4.a. phrase are the earlier to get (someone's) rag out (to make (someone) angry) and to get one's rag out (to become angry). These are originally from Yorkshire, first quotation 1862, with unknown origin but suggest a comparison with red rag (1720, a piece of red cloth to provoke an animal, as in like a red rag to a bull) and the verb rag (1739, to scold).
Solution 3:
Apparently the 'rag' in question here is your tongue, or control over it: http://users.tinyonline.co.uk/gswithenbank/sayingsc.htm#Chew%20the%20rag