The method of re-introducing atomistic detail into a coarse-grained polymer structure, so-called backmapping, is extended to a nonequilibrium situation. Problems in backmapping coarse-grained polymer models, on which a nonequilibrium shear flow has been imposed, are discussed. A backmapping protocol, where the globally deformed conformations are maintained during backmapping by applying position restraints, is proposed. The local optimization of the atomistic structure is performed in the presence of these restraints. The artifact of segment isolation introduced by position restraints is minimized by applying different restraint patterns iteratively. The procedure is demonstrated on the test case of atactic polystyrene under a steady shear flow.