oh-my-git/levels/shit-happens/restore-a-file

22 lines
459 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]
# Restore the essay to contain "important content"
test "$(cat essay)" = "important content"