I'm not familiar with the Comanche, but it is probably like most retracts and has some method for prevention of gear retraction on the ground. I rode in one as a student, and it had a single small gear handle that was like most electric style retracts, so that would be my guess. I would suppose it has a microswitch somewhere on one of the mains.
Squat switches work by interrupting the signal, in the case of electric and electrohydraulic systems, to the electric motor. So if you put the handle up accidentally while on the ground, the motor doesn't activate, and the downlocks stay in place.
The problem comes when the switch is momentarily released (or engaged or "sensed", more on that later) while moving on the ground. If you take a turn a bit fast or go over a bump, the strut can extend a bit, and the squat switch may be displaced enough to allow the motor to operate...the downlocks are disengaged and up comes the gear.
Like Ed said, with Cessna single retracts, there is a squat switch on the nose (at least the 182 RG was that way, along with the 172). There are other microswitches for the up and down lights. The 310 wasn't dissimilar in operation. Debonairs also had a switch on the right main, but if I remember correctly, sitting on the ground, the switch was open instead of closed. It had the same result. Jim Hillibrand could confirm or refute that. The Aero Commander didn't have a squat switch since the gear was actuated totally by an engine driven hydraulic system, and the gear handle, a valve to direct hydraulic flow, had a manual guard to prevent unintentional retraction. The TBM has sensors built into the gear legs. The PC12, instead of microswitches, has proximity sensors (aka "prox switches") that never physically touch anything, but sense their proximity to metal tabs as the gear is moved about.
They are all differing systems to do the same thing...attempt to keep the gear down if the pilot screws up. Unfortunately, pilots will always find new and exciting ways to defeat any system. The best system for operating any part of an aircraft is in between the pilot's ears. Too bad that one's not foolproof either. All you can do is continue to train for the plane and be consistent with your procedures, whatever they may be.