A procedure is presented to untangle unstructured 2D meshes containing inverted elements by node repositioning. The inverted elements may result from node movement in ALE (Arbitrary Lagrangian Eulerian) simulations of continuum mechanics problems with large shear deformation such as fluid flow and metal forming. Meshes with inverted elements may also be created due to the limitations of mesh generation algorithms particularly for non-simplicial mesh generation. The untangling procedure uses a combination of direct node placement based on geometric computation of the feasible set and node repositioning driven by numerical optimization of an objective function that achieves its minimum on a valid mesh. It is shown that a combination of the feasible set based method and the optimization method achieves the best results in untangling complex 2D meshes. Preliminary results are also presented for untangling of 3D unstructured meshes by the same approach.