mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2025-05-07 05:02:04 +02:00
shit-happens chapter :P
This commit is contained in:
parent
9109394271
commit
12ea306302
7 changed files with 169 additions and 0 deletions
levels/shit-happens
22
levels/shit-happens/restore-a-file-from-the-past
Normal file
22
levels/shit-happens/restore-a-file-from-the-past
Normal file
|
@ -0,0 +1,22 @@
|
|||
title = Restore a deleted file
|
||||
cards = checkout
|
||||
|
||||
[description]
|
||||
|
||||
Oops - you deleted the "essay" file, which you worked on all night!
|
||||
|
||||
Luckily, Git is here to help! You can use `git checkout` to restore the file!
|
||||
|
||||
[setup]
|
||||
|
||||
echo important > essay
|
||||
git add .
|
||||
git commit -m "Initial commit"
|
||||
echo "important content" > essay
|
||||
git commit -am "Improve essay"
|
||||
rm essay
|
||||
|
||||
[win]
|
||||
|
||||
# Make changes to all three files, and add all of them to the index.
|
||||
test "$(cat essay)" = "important content"
|
Loading…
Add table
Add a link
Reference in a new issue