Index: src/Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.cpp
===================================================================
--- src/Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.cpp	(revision 9eed14556f43d3d76fbfe103498906d6bf32e9f0)
+++ src/Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.cpp	(revision cdc2f5d227eca5bc238396f1ede10908ae576daa)
@@ -35,6 +35,9 @@
 //#include "CodePatterns/MemDebug.hpp"
 
+#include "CodePatterns/Assert.hpp"
 #include "CodePatterns/Log.hpp"
-#include "CodePatterns/Verbose.hpp"
+
+#include "Actions/UndoRedoHelpers.hpp"
+#include "Atom/AtomicInfo.hpp"
 #include "LinearAlgebra/Line.hpp"
 #include "LinearAlgebra/RealSpaceMatrix.hpp"
@@ -58,31 +61,54 @@
   molecule *mol = NULL;
 
+  std::vector<AtomicInfo> UndoInfo;
   for (World::MoleculeSelectionIterator iter = World::getInstance().beginMoleculeSelection(); iter != World::getInstance().endMoleculeSelection(); ++iter) {
     mol = iter->second;
     LOG(0, "Converting to prinicipal axis system.");
 
-    RealSpaceMatrix InertiaTensor = mol->getInertiaTensor();
+    // gather undo information: store position of all atoms of molecule
+    UndoInfo.reserve(UndoInfo.size()+mol->size());
+    {
+      for (molecule::const_iterator iter = const_cast<molecule const *>(mol)->begin();
+          iter != const_cast<molecule const *>(mol)->end();
+          ++iter) {
+        const atom * const Walker = *iter;
+        UndoInfo.push_back(AtomicInfo(*Walker));
+      }
+    }
 
+    // rotate
+//    RealSpaceMatrix InertiaTensor = mol->getInertiaTensor();
     mol->RotateToPrincipalAxisSystem(params.Axis.get());
 
     // summing anew for debugging (resulting matrix has to be diagonal!)
-    InertiaTensor = mol->getInertiaTensor();
+    RealSpaceMatrix InertiaTensor = mol->getInertiaTensor();
   }
-  return Action::success;
+
+  MoleculeRotateToPrincipalAxisSystemState *UndoState =
+      new MoleculeRotateToPrincipalAxisSystemState(UndoInfo, params);
+  return ActionState::ptr(UndoState);
 }
 
 ActionState::ptr MoleculeRotateToPrincipalAxisSystemAction::performUndo(ActionState::ptr _state) {
-//  MoleculeRotateToPrincipalAxisSystemState *state = assert_cast<MoleculeRotateToPrincipalAxisSystemState*>(_state.get());
+  MoleculeRotateToPrincipalAxisSystemState *state =
+      assert_cast<MoleculeRotateToPrincipalAxisSystemState*>(_state.get());
 
-//  string newName = state->mol->getName();
-//  state->mol->setName(state->lastName);
+  // set stored old state
+  SetAtomsFromAtomicInfo(state->undoinfo);
 
-  STATUS("Undo of MoleculeRotateToPrincipalAxisSystemAction not implemented.");
-  return Action::failure;
+  return ActionState::ptr(_state);
 }
 
 ActionState::ptr MoleculeRotateToPrincipalAxisSystemAction::performRedo(ActionState::ptr _state){
-  STATUS("Redo of MoleculeRotateToPrincipalAxisSystemAction not implemented.");
-  return Action::failure;
+  MoleculeRotateToPrincipalAxisSystemState *state =
+      assert_cast<MoleculeRotateToPrincipalAxisSystemState*>(_state.get());
+
+  for (World::MoleculeSelectionIterator iter = World::getInstance().beginMoleculeSelection();
+      iter != World::getInstance().endMoleculeSelection(); ++iter) {
+    molecule * const mol = iter->second;
+    mol->RotateToPrincipalAxisSystem(state->params.Axis.get());
+  }
+
+  return ActionState::ptr(_state);
 }
 
Index: src/Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.def
===================================================================
--- src/Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.def	(revision 9eed14556f43d3d76fbfe103498906d6bf32e9f0)
+++ src/Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.def	(revision cdc2f5d227eca5bc238396f1ede10908ae576daa)
@@ -7,5 +7,8 @@
 
 // all includes and forward declarations necessary for non-integral types below
+#include <vector>
+
 #include "Actions/Values.hpp"
+#include "Atom/AtomicInfo.hpp"
 #include "LinearAlgebra/Vector.hpp"
 
@@ -23,6 +26,6 @@
 (VectorNotZeroValidator())
 
-#undef statetypes
-#undef statereferences
+#define statetypes (std::vector<AtomicInfo>)
+#define statereferences (undoinfo)
 
 // some defines for all the names, you may use ACTION, STATE and PARAMS
Index: tests/regression/Molecules/RotateToPrincipalAxisSystem/testsuite-molecules-rotate-to-principal-axis-system.at
===================================================================
--- tests/regression/Molecules/RotateToPrincipalAxisSystem/testsuite-molecules-rotate-to-principal-axis-system.at	(revision 9eed14556f43d3d76fbfe103498906d6bf32e9f0)
+++ tests/regression/Molecules/RotateToPrincipalAxisSystem/testsuite-molecules-rotate-to-principal-axis-system.at	(revision cdc2f5d227eca5bc238396f1ede10908ae576daa)
@@ -49,5 +49,4 @@
 
 AT_SETUP([Molecules - Rotate to PAS with Undo])
-AT_XFAIL_IF([/bin/true])
 AT_KEYWORDS([molecules rotate-to-principal-axis-system undo])
 
@@ -80,5 +79,4 @@
 
 AT_SETUP([Molecules - Rotate to PAS with Redo])
-AT_XFAIL_IF([/bin/true])
 AT_KEYWORDS([molecules rotate-to-principal-axis-system redo])
 
