For the production of lactic acid we need pyruvate from glycolysis. This process is known as lactic acid fermentation. One of the features of this process is reversibility. How does this reversibility work?
The enzyme catalysing this reaction in mammals is lactate dehydrogenase of which there are two major isoforms: LDHA and LDHB. The general reaction scheme can be shown as:
In muscles LDHA reduces pyruvate to lactate consuming one NADH. This gets rid of the electrons which would normally go through the respiratory chain. The lactic acid is then transported to the liver where it is turned back into pyruvate by LDHA producing one NADH. This is know as the Cori cycle.
Both enzymes however are very similar and can catalyse the reaction into either direction, they are just slightly different in structure which make them have a greater affinity for pyruvate or lactate.