oh-my-git/levels/index/reset
blinry 97a7c40ba3 Symbols for index-modifying cards, remove index/mv level for now
Plus better descriptions for pull/push/fetch.
2021-01-14 11:26:21 +01:00

33 lines
656 B
Plaintext

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"