Origen

The garments shirt and skirt (Middle English) share an ancient root, which is also that of short, the basic sense probably being ‘short garment’. The idea behind shirty (mid 19th century), ‘bad-tempered or annoyed’, is the same as that behind keep your shirt on, ‘don't lose your temper, stay calm’. The offended or riled person is about to take his shirt off ready for a fight. In lose your shirt or put your shirt on the shirt is seen as the very last possession that you could use to bet with.