Index: src/wp-includes/post.php
===================================================================
--- src/wp-includes/post.php	(revision 37167)
+++ src/wp-includes/post.php	(working copy)
@@ -5340,6 +5340,11 @@
 		return;
 	}
 
+	// Don't bother if the slug is being changed by untrashing a post.
+	if ( '__trashed' === substr( $post_before->post_name, -9 ) ) {
+		return;
+	}
+
 	// We're only concerned with published, non-hierarchical objects.
 	if ( ! ( 'publish' === $post->post_status || ( 'attachment' === get_post_type( $post ) && 'inherit' === $post->post_status ) ) || is_post_type_hierarchical( $post->post_type ) ) {
 		return;
Index: tests/phpunit/tests/post/wpCheckForChangedSlugs.php
===================================================================
--- tests/phpunit/tests/post/wpCheckForChangedSlugs.php	(nonexistent)
+++ tests/phpunit/tests/post/wpCheckForChangedSlugs.php	(working copy)
@@ -0,0 +1,23 @@
+<?php
+
+/**
+ * @group post
+ */
+class Tests_WPCheckForChangedSlugs extends WP_UnitTestCase {
+
+	/**
+	 * @ticket 11863
+	 */
+	function test_untrashing_a_post_should_not_store_the_temporary_trashed_slug() {
+		$about_page_id = self::factory()->post->create( array(
+			'post_type' => 'page',
+			'post_title' => 'About',
+			'post_status' => 'publish'
+		) );
+		wp_trash_post( $about_page_id );
+
+		wp_untrash_post( $about_page_id );
+
+		$this->assertEquals( false, get_post_meta( $about_page_id, '_wp_old_slug', true ) );
+	}
+}
