diff --git wp-includes/query.php wp-includes/query.php
index 04286aa..a322288 100644
--- wp-includes/query.php
+++ wp-includes/query.php
@@ -3568,6 +3568,21 @@ class WP_Query {
 		global $wp_the_query;
 		return $wp_the_query === $this;
 	}
+
+	/**
+	 * After looping through a nested query, this function
+	 * restores the $post global to the current post in this query
+	 *
+	 * @since 3.7.0
+	 *
+	 * @return bool
+	 */
+	function reset_postdata() {
+		if ( ! empty( $this->post ) ) {
+			$GLOBALS['post'] = $this->post;
+			setup_postdata( $this->post );
+		}
+	}
 }
 
 /**
