> For the complete documentation index, see [llms.txt](https://gittutorial.gitbook.io/practical-git-via-gitextensions/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gittutorial.gitbook.io/practical-git-via-gitextensions/lost-and-found.md).

# Lost and Found

### reflog

Whenever the HEAD (the current commit) changes, git will create a reflog. We can get it as long as the changes were commited.

### Reflog in Grid View

You can right click any where in the commit grid view and in the context menu select `View` -> `Show Ref log References`

![](/files/-MYsGrXS29QESQkxmFS3)

## Reflog List in GitExtensions

To access the reflog, we go to the `Commands` menu and select the `Show reflog` menu item.

![](/files/-MYsGNql113LB1QjgKQP)

In the form we can see where the HEAD used to point to. Sometimes it's hard to tell which is the one we want, unfortunately there is not preview of the commit but we can create branches for couple of the HEADs and then go back to the main revision grid. We can do a `Hard` to the commit once we find it.

![](/files/-MYsGZrnzFN6T8AahfXf)

Command line:

```
git reflog -n # where n is the number of log items to show
git reset --hard <TheCommitSHA>
```

## Recover via Git `Maintenance`

`Repository Menu -> Git Maintenance -> Recover Lost Objects...`


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://gittutorial.gitbook.io/practical-git-via-gitextensions/lost-and-found.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
