I managed to do this when I was a teenager. Ulnar nerve pinch. In my case it persisted for a couple of months. It wasn't painful—it was if those fingers were "asleep" with mild pins and needles.
You can avoid it by wearing better gloves and swapping up your hand position, but I don't know how to treat it once it has happened. Perhaps OTC anti-inflammatories or steroids?