From 36dbad482513c6b176873824fb9ece83ca40c409 Mon Sep 17 00:00:00 2001
From: Orestis Malaspinas <orestis.malaspinas@hesge.ch>
Date: Mon, 5 Mar 2018 10:48:20 +0100
Subject: [PATCH] en train de travailler sur le reset

---
 git_tutorial.md | 100 +++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 98 insertions(+), 2 deletions(-)

diff --git a/git_tutorial.md b/git_tutorial.md
index 08ac74e..1f884a6 100644
--- a/git_tutorial.md
+++ b/git_tutorial.md
@@ -1,4 +1,6 @@
 % Introduction à Git
+% Orestis Malaspinas
+% Version 
 
 # Des références
 
@@ -194,11 +196,105 @@ Date:   Sun Mar 4 22:25:24 2018 +0100
     mon premier commit
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-# Revenir en arrière dans l'historique (1/3)
+# Revenir en arrière dans l'historique (1/5)
 
 ## Commandes: `git checkout`, `git reset`
 
-1. Faire une modification dans un fichier qu'on aurait pas dû faire.
+1. Faire une modification dans un fichier qu'on aurait pas voulu faire.
 2. Faire un `git add` qu'on aurait pas dû faire.
 3. Faire un `git commit` qu'on aurait pas dû faire.
 
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.bash .numberLines}
+[tutorial]$ echo Oh no! An awful modification! > premierfichier.c
+[tutorial]$ git status
+On branch master
+Your branch is up to date with 'origin/master'.
+
+Changes not staged for commit:
+  (use "git add <file>..." to update what will be committed)
+  (use "git checkout -- <file>..." to discard changes in working directory)
+
+	modified:   premierfichier.c
+
+no changes added to commit (use "git add" and/or "git commit -a")
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+# Revenir en arrière dans l'historique (2/5)
+
+## Commandes: `git checkout`, `git reset`
+
+### Une modification dans un fichier qu'on aurait pas voulu faire.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.bash .numberLines}
+[tutorial]$ git checkout premierfichier.c 
+[tutorial]$ git status
+On branch master
+Your branch is up to date with 'origin/master'.
+
+nothing to commit, working tree clean
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+# Revenir en arrière dans l'historique (3/5)
+
+## Commandes: `git checkout`, `git reset`
+
+### Faire un `git add` qu'on aurait pas dû faire.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.bash .numberLines}
+[tutorial]$ echo Oh no! An awful modification! > premierfichier.c
+[tutorial]$ git add premierfichier.c
+[tutorial]$ git status
+On branch master
+Your branch is up to date with 'origin/master'.
+
+Changes to be committed:
+  (use "git reset HEAD <file>..." to unstage)
+
+	modified:   premierfichier.c
+[tutorial]$ git reset HEAD
+Unstaged changes after reset:
+M	premierfichier.c
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+# Revenir en arrière dans l'historique (4/5)
+
+## Commandes: `git checkout`, `git reset`
+
+### Faire un `git add` qu'on aurait pas dû faire.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.bash .numberLines}
+[tutorial]$ git status
+On branch master
+Your branch is up to date with 'origin/master'.
+
+Changes not staged for commit:
+  (use "git add <file>..." to update what will be committed)
+  (use "git checkout -- <file>..." to discard changes in working directory)
+
+	modified:   premierfichier.c
+
+no changes added to commit (use "git add" and/or "git commit -a")
+[tutorial]$ git diff
+diff --git a/premierfichier.c b/premierfichier.c
+index 9622e40..cfd5469 100644
+--- a/premierfichier.c
++++ b/premierfichier.c
+@@ -1 +1 @@
+-Wild World
++Oh no! An awful modification!
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+# Revenir en arrière dans l'historique (4/5)
+
+## Commandes: `git checkout`, `git reset`
+
+### Faire un `git commit` qu'on aurait pas dû faire.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.bash .numberLines}
+[tutorial]$ git commit -am "troisieme commit"
+[master 0563c02] troisieme commit
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+[tutorial]$ git reset f9ab3ec4a00c46a12d7a45f133295acc5fb5cd20
+[tutorial]$ git checkout premierfichier.c
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- 
GitLab