It is cited in print as far back as 1811. It was underworld slang for “keep quiet.” (instantly)
There is quite a bit of criminal slang that was meant to be ‘mysterious’ to average people who overheard it. Sort of code. I’m not saying that is the case, but it could have been.
“Cheese it” = smile the way you do when someone’s taking your picture and tells you to say “cheese”, i.e., look pleasantly innocent here come the cops.
It’s derived from “cut the cheese” which is to fart. When the cops are coming after you, you should let off the smelliest fart possible so that the cops fall ill and stop chasing you.
No, no, no, no, no! It comes from Wales and it is based on their national dish ‘Welsh Rarebit’ or cheese on toast. ‘Cheese it’ simply means to act like the cheese under a grill. Melt. Melt away into the night from the cops. Like cheese.
Well then, with the OP more or less answered, and summer coming on, this seems like the perfect time to mention the highly entertaining sport of Cheese Racing.
Well if things are gonna get cheesetastic the I’ll see your ‘cheese racing’ and raise you the ultra dangerous cheese tolling. I recommend googling 'cheese rolling and looking for more pictures, I’ts very psycho.
‘rolling’ not ‘tolling’. Now that link wasn’t the one I wanted this is the one I wanted to show you. Go down about a third of the way down the page and click in the ‘seeing is believing’ section coloured blue to start the picture gallery.