Index: src/Actions/AtomAction/ChangeElementAction.cpp
===================================================================
--- src/Actions/AtomAction/ChangeElementAction.cpp	(revision e41c48e834f26d3742f334149b34497a3b8c486c)
+++ src/Actions/AtomAction/ChangeElementAction.cpp	(revision f8456cc5b864ea00415d64f971dce5a982883a58)
@@ -10,4 +10,5 @@
 #include "Actions/AtomAction/ChangeElementAction.hpp"
 #include "Actions/ActionRegistry.hpp"
+#include "Descriptors/AtomIdDescriptor.hpp"
 #include "atom.hpp"
 #include "element.hpp"
@@ -19,4 +20,5 @@
 
 #include <iostream>
+#include <map>
 #include <string>
 
@@ -26,4 +28,18 @@
 #include "UIElements/Dialog.hpp"
 #include "Actions/ValueStorage.hpp"
+
+typedef std::map<int, const element *> ElementMap;
+
+// memento to remember the state when undoing
+
+class AtomChangeElementState : public ActionState {
+public:
+  AtomChangeElementState(ElementMap _Elements, const element *_elemental) :
+    Elements(_Elements),
+    elemental(_elemental)
+  {}
+  ElementMap Elements;
+  const element *elemental;
+};
 
 const char AtomChangeElementAction::NAME[] = "change-element";
@@ -56,4 +72,11 @@
   ValueStorage::getInstance().queryCurrentValue(NAME, elemental);
 
+  // create undo state
+  ElementMap Elements;
+  for (World::AtomSelectionIterator iter = World::getInstance().beginAtomSelection(); iter != World::getInstance().endAtomSelection(); ++iter) {
+    Elements.insert(std::pair<int, const element *> (iter->second->getId(), iter->second->getType()));
+  }
+  AtomChangeElementState *UndoState = new AtomChangeElementState(Elements, elemental);
+
   for (World::AtomSelectionIterator iter = World::getInstance().beginAtomSelection(); iter != World::getInstance().endAtomSelection(); ++iter) {
     first = iter->second;
@@ -64,27 +87,45 @@
     mol->AddAtom(first);  // add atom to ensure correctness of formula
   }
-  return Action::success;
+  return Action::state_ptr(UndoState);
 }
 
 Action::state_ptr AtomChangeElementAction::performUndo(Action::state_ptr _state) {
-//  ParserLoadXyzState *state = assert_cast<ParserLoadXyzState*>(_state.get());
+  AtomChangeElementState *state = assert_cast<AtomChangeElementState*>(_state.get());
+  atom *first = NULL;
+  molecule *mol = NULL;
 
-  return Action::failure;
-//  string newName = state->mol->getName();
-//  state->mol->setName(state->lastName);
-//
-//  return Action::state_ptr(new ParserLoadXyzState(state->mol,newName));
+  for(ElementMap::const_iterator iter = state->Elements.begin(); iter != state->Elements.end(); ++iter) {
+    first = World::getInstance().getAtom(AtomById(iter->first));
+    mol = first->getMolecule();
+    first->removeFromMolecule(); // remove atom
+    first->setType(iter->second);
+    mol->AddAtom(first);  // add atom to ensure correctness of formula
+  }
+
+  return Action::state_ptr(_state);
 }
 
 Action::state_ptr AtomChangeElementAction::performRedo(Action::state_ptr _state){
-  return Action::failure;
+  AtomChangeElementState *state = assert_cast<AtomChangeElementState*>(_state.get());
+  atom *first = NULL;
+  molecule *mol = NULL;
+
+  for(ElementMap::const_iterator iter = state->Elements.begin(); iter != state->Elements.end(); ++iter) {
+    first = World::getInstance().getAtom(AtomById(iter->first));
+    mol = first->getMolecule();
+    first->removeFromMolecule(); // remove atom
+    first->setType(state->elemental);
+    mol->AddAtom(first);  // add atom to ensure correctness of formula
+  }
+
+  return Action::state_ptr(_state);
 }
 
 bool AtomChangeElementAction::canUndo() {
-  return false;
+  return true;
 }
 
 bool AtomChangeElementAction::shouldUndo() {
-  return false;
+  return true;
 }
 
Index: tests/regression/testsuite-simple_configuration.at
===================================================================
--- tests/regression/testsuite-simple_configuration.at	(revision e41c48e834f26d3742f334149b34497a3b8c486c)
+++ tests/regression/testsuite-simple_configuration.at	(revision f8456cc5b864ea00415d64f971dce5a982883a58)
@@ -37,4 +37,13 @@
 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/4/pre/test.xyz test.xyz], 0)
 AT_CHECK([../../molecuilder -i test.xyz -e ${abs_top_srcdir}/src/ --select-atom-by-id 0 -E 6 ], 0, [ignore], [ignore])
+AT_CHECK([file=test.xyz; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/4/post/$file], 0, [ignore], [ignore])
+AT_CLEANUP
+AT_SETUP([Simple configuration - Changing element with Undo/Redo])
+AT_KEYWORDS([configuration])
+AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/4/pre/test.xyz test.xyz], 0)
+AT_CHECK([../../molecuilder -i test.xyz -e ${abs_top_srcdir}/src/ --select-atom-by-id 0 -E 6 --undo], 0, [ignore], [ignore])
+AT_CHECK([file=test.xyz; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/4/pre/$file], 0, [ignore], [ignore])
+AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/4/pre/test.xyz test.xyz], 0)
+AT_CHECK([../../molecuilder -i test.xyz -e ${abs_top_srcdir}/src/ --select-atom-by-id 0 -E 6 --undo --redo], 0, [ignore], [ignore])
 AT_CHECK([file=test.xyz; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/4/post/$file], 0, [ignore], [ignore])
 AT_CLEANUP
