The history panel displays the list of queries that have been executed in the current user-session. You can select any query from the list to display it on the query panel. The history panel will store a query in it's list only if the query has executed successfully.