Index: trunk/ippTools/src/camtool.c
===================================================================
--- trunk/ippTools/src/camtool.c	(revision 14023)
+++ trunk/ippTools/src/camtool.c	(revision 14100)
@@ -34,4 +34,5 @@
 static bool addprocessedexpMode(pxConfig *config);
 static bool processedexpMode(pxConfig *config);
+static bool revertprocessedexpMode(pxConfig *config);
 static bool updateprocessedexpMode(pxConfig *config);
 static bool blockMode(pxConfig *config);
@@ -62,4 +63,5 @@
         MODECASE(CAMTOOL_MODE_ADDPROCESSEDEXP,      addprocessedexpMode);
         MODECASE(CAMTOOL_MODE_PROCESSEDEXP,         processedexpMode);
+        MODECASE(CAMTOOL_MODE_REVERTPROCESSEDEXP,   revertprocessedexpMode);
         MODECASE(CAMTOOL_MODE_UPDATEPROCESSEDEXP,   updateprocessedexpMode);
         MODECASE(CAMTOOL_MODE_BLOCK,                blockMode);
@@ -757,4 +759,36 @@
 
 
+static bool revertprocessedexpMode(pxConfig *config)
+{
+    PS_ASSERT_PTR_NON_NULL(config, false);
+
+    psString query = pxDataGet("camtool_revertprocessedexp.sql");
+    if (!query) {
+        psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement");
+        return false;
+    }
+
+    if (config->where) {
+        psString whereClause = psDBGenerateWhereConditionSQL(config->where, "camProcessedExp");
+        psStringAppend(&query, " AND %s", whereClause);
+        psFree(whereClause);
+    }
+
+    if (!p_psDBRunQuery(config->dbh, query)) {
+        psError(PS_ERR_UNKNOWN, false, "database error");
+        psFree(query);
+        return false;
+    }
+    psFree(query);
+
+    if (psDBAffectedRows(config->dbh) < 1) {
+        psError(PS_ERR_UNKNOWN, false, "should have affected atleast 1 row");
+        return false;
+    }
+
+    return true;
+}
+
+
 static bool updateprocessedexpMode(pxConfig *config)
 {
