Files
tldr/pages.fr/common/git-revert.md
2021-10-01 15:47:08 -03:00

21 lines
556 B
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# git revert
> Créer un nouveau commit qui efface les changements du précédent.
> Plus d'informations : <https://git-scm.com/docs/git-revert>.
- Crée un commit qui annule les changements du dernier commit :
`git revert {{HEAD}}`
- Crée un commit qui annule les changements des 5 dernier commit :
`git revert HEAD~{{4}}`
- Crée un commit qui annule les changements de plusieurs commit :
`git revert {{master~5..master~2}}`
- Ne pas créer de nouveau commit, remplacer uniquement dans l'arbre courant :
`git revert -n {{0c01a9..9a1743}}`