> For the complete documentation index, see [llms.txt](https://cumbucadev.gitbook.io/github-essentials/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cumbucadev.gitbook.io/github-essentials/dia-4/sua-vez/exercicio-5.md).

# Exercício 5

## Revertendo um commit

Neste exercício, você vai praticar como desfazer um commit no seu projeto `lista-de-leituras` sem apagar o histórico do repositório.

Imagine que você cometeu um engano: adicionou um livro ao arquivo `lidos.txt`, mas depois percebeu que ainda não terminou de lê-lo.

### ✅ Tarefa

Adicione um novo título ao arquivo `lidos.txt`, faça um commit com essa alteração e depois reverta esse commit utilizando o comando `git revert`.

***

#### 💡Dica&#x20;

1. **Faça uma alteração simples no projeto**\
   Modifique um arquivo para simular uma mudança que será registrada no histórico.
2. **Salve e registre a alteração em um commit**\
   Confirme que a mudança foi registrada corretamente no histórico de commits.
3. **Verifique o histórico do repositório**\
   Assim você entende melhor em que ponto está e qual commit será revertido.
4. **Reverta o commit recém-criado**\
   Use o comando apropriado para desfazer o commit anterior, criando um novo commit com a reversão.
5. **Confirme que a reversão foi aplicada**\
   Verifique se o conteúdo do projeto voltou ao estado anterior à mudança.
6. **Revise o histórico para observar o commit de reversão**\
   Isso ajuda a entender como o Git lida com esse tipo de operação.


---

# 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:

```
GET https://cumbucadev.gitbook.io/github-essentials/dia-4/sua-vez/exercicio-5.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
