mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2024-12-22 20:32:38 +01:00
23 lines
477 B
Text
23 lines
477 B
Text
|
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"
|