A new method for a regioselective introduction of a bis(methoxycarbonyl)-methyl group into the 4-position of the piperidine skeleton was explored, and this method was applied to the preparation of cis- and trans-2,4-disubstituted piperidines starting from 2-piperidinecarboxylic acid. The key steps in the method involved electrochemical oxidation of carbamates.