Involved in biosynthesis of the repeating tetrasaccharide unit of the O-antigen. Catalyzes the reversible epimerization of the hydroxyl group at position C4 of undecaprenyl pyrophosphate-N-acetylglucosamine (UndPP-GlcNAc) to yield undecaprenyl pyrophosphate-N-acetylgalactosamine (UndPP-GalNAc). N-acetyl-alpha-D-glucosaminyl-di-trans,octa-cis-undecaprenyl diphosphate = N-acetyl-alpha-D-galactosaminyl-di-trans,octa-cis-undecaprenyl diphosphate Bacterial outer membrane biogenesis; LPS O-antigen biosynthesis. Belongs to the NAD(P)-dependent epimerase/dehydratase family.