diff --git a/2019/2019-09-24_advancedGitTraining/slides/revert.md b/2019/2019-09-24_advancedGitTraining/slides/revert.md index d0449433e5de23b39a0a0c6cde7c5baa18576779..1abc41c93f638f6452839710fed1d16c802d34c0 100644 --- a/2019/2019-09-24_advancedGitTraining/slides/revert.md +++ b/2019/2019-09-24_advancedGitTraining/slides/revert.md @@ -1,22 +1,25 @@ -# Theory: Git Revert +# Reverting a commit -* Enables the deletion of committed commits +* Enables the deletion of committed commits by reverting the changes. +* A trace is kept in history of the original commit and the reverted one. -# Practical: Git Revert +# Example: * On your branch, create and commit a file: ```bash -$ echo "# This commits contains errors" > revert.txt -$ git add revert.txt -$ git commit -m "Error" +$ cd attendees +$ echo "# Grades for Firstname Lastname" > grades.md +$ git add grades.md +$ git commit -m "File with grades for Firstname Lastname" ``` -* check the commit log and copy the `Error` commit ID: + +* check the commit log and copy the SHA1: ```bash $ git log ``` -* Use the 'git revert' command to undo this selected commit: +* Use the `git revert` command to undo this selected commit: ```bash $ git revert <sha1> ```