Cat 730 truck was stuck in mud on uneven ground. Operator had assisted in hooking up tow cables to haul truck. As operator was climbing back into the cab, the door slammed shut on his right thumb. Thumb had slight bruise. Operator was given medication for pain causing restricted duty for two days.