diff --git a/content_lock.module b/content_lock.module
index 65be26b..f657997 100644
--- a/content_lock.module
+++ b/content_lock.module
@@ -145,15 +145,23 @@ function content_lock_nodeapi(&$node, $op, $teaser, $page) {
  */
 function content_lock_form_alter(&$form, &$form_state, $form_id) {
   global $user;
+
   $node = empty($form['#node']) ? NULL : $form['#node'];
   $nid = empty($form['nid']['#value']) ? NULL : $form['nid']['#value'];
 
+  /* Ensure that users acquire a lock when reverting a node to an older revision. */
+  if (!empty($form['#node_revision'])) {
+    $node = $form['#node_revision'];
+    $nid = $node->nid;
+  }
+
   /* **************** Restore the node format ****************************** */
   // _content_lock_is_lockable_node() needs to know the original
   // node format. We either dig up a stashed content_lock_old_format or
   // initialize it here.
   // Only touch node edit forms:
-  if (is_object($node) && is_numeric($nid) && $node->type . '_node_form' == $form_id) {
+  if (is_object($node) && is_numeric($nid)
+      && ($node->type . '_node_form' == $form_id || $form_id == 'node_revision_revert_confirm')) {
       $old_format = $node->format;
       if (!empty($node->content_lock_old_format)) {
 	$old_format = $node->content_lock_old_format;
@@ -190,7 +198,6 @@ function content_lock_form_alter(&$form, &$form_state, $form_id) {
       if(variable_get('content_lock_unload_js', true)) {
         $form['#after_build'][] = '_content_lock_add_unload_js';
       }
-
       // Add some minor things to the form
       _content_lock_add_nodeadministration($form, $form_state, $form_id);
       // Adding cancel button, if configured
@@ -222,6 +229,12 @@ function content_lock_form_alter(&$form, &$form_state, $form_id) {
 function content_lock_content_lock_skip_locking($node, $form_id, $form, $form_state) {
   global $user;
   $nid = empty($form['nid']['#value']) ? NULL : $form['nid']['#value'];
+
+  /* support the node revision form by not requiring the form to have an 'nid' key */
+  if (empty($nid) && $form_id == 'node_revision_revert_confirm' && !empty($form['#node_revision'])) {
+    $nid = $node->nid;
+  }
+
   // Locked node types. Dont mix this up with the content_types you can chose on the admin form of content lock
   // this types are forced due to disfunctionality
   $node_type_blacklist = array(
@@ -244,8 +257,8 @@ function content_lock_content_lock_skip_locking($node, $form_id, $form, $form_st
       || !empty($form_id_blacklist[$form_id])     // If this form is blacklisted, don't lock.
       || $user->uid <= 0                          // A valid user is needed for locking
       || !user_access('check out documents')      // The user must have this permission to be able to lock.
-      || $form_id != $node->type . '_node_form'   // See node_forms(). Don't lock custom forms just because
-                                                  //   they have $form['nid'] and $form['#node'].
+      || ($form_id != $node->type . '_node_form'  // See node_forms(). Don't lock custom forms just because
+          && $form_id != 'node_revision_revert_confirm') // they have $form['nid'] and $form['#node'].
   ) {
     // Preconditions failed, skip the lock
     return TRUE;
@@ -323,6 +336,14 @@ function _content_lock_add_cancelbutton(&$form, $form_state, $form_id) {
       $form['buttons']['cancel']['#weight'] = 2000;
       $form['buttons']['cancel']['#value'] = l(t('Cancel'), '', array( 'attributes' => array( 'class' => 'form-submit form-submit-cancel', 'rel' => 'nofollow')));
     }
+    // revert node
+    else if ($form['#id'] == 'node-revision-revert-confirm') {
+      /* hijack the default cancel button */
+      $node = $form['#node_revision'];
+      $form['actions']['cancel']['#value'] = l(t('Cancel'), 'node/' . $node->id . '/canceledit',
+        array('query' => array('destination' => 'node/' . $node->nid . '/revisions'),
+              'attributes' => array('class' => 'form-submit form-submit-cancel')));
+    }
   }
 }
 
