mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2024-11-03 19:04:40 +01:00
97a7c40ba3
Plus better descriptions for pull/push/fetch.
32 lines
656 B
Text
32 lines
656 B
Text
title = Resetting files in the index
|
|
cards = add reset-file commit
|
|
|
|
[description]
|
|
|
|
See the dark shadow behind the icons? That's the version of the commit you're at!
|
|
|
|
If you already have updated the index to a changed file, but want to reset it, you can use `git reset`!
|
|
|
|
[setup]
|
|
|
|
echo a > a
|
|
echo b > b
|
|
echo c > c
|
|
git add .
|
|
git commit -m "Initial commit"
|
|
echo x > a
|
|
echo x > b
|
|
echo x > c
|
|
git add .
|
|
|
|
[win]
|
|
|
|
# Reset the changes in a and c
|
|
test "$(git show :a)" == "a" &&
|
|
test "$(git show :b)" != "a" &&
|
|
test "$(git show :c)" == "c"
|
|
|
|
# And make a commit!
|
|
test "$(git show main:a)" == "a" &&
|
|
test "$(git show main:b)" != "b" &&
|
|
test "$(git show main:c)" == "c"
|