I was simply trying out a few things on a project and wanted to delete some modified files I was working with but no longer needed.
I got careless and typed git checkout file
instead of git checkout -- file
. So essentially I was just checking out this modified file and I have no clue where that modified file went off to.
I've tried using git update-index --fresh
just to try and see where this modified file could have gone but it seems like it may have been deleted in the end?
modified: test/ssc_test/cmod_tcsdirect_steam_test.cpp
modified: test/ssc_test/cmod_tcsfresnel_molten_salt_test.cpp
modified: test/ssc_test/cmod_tcsmolten_salt_test.cpp
These were the files I was trying to get rid of but forgot to add the --
to get rid of one of the edited files.
After checking out this file, instead of deleting it, it gave me the message, Updated 1 path from the index
and it was no longer displayed along with the other modified files when using git status
.
I'm pretty clueless with what happened exactly. Was it was deleted or hidden somewhere in the index, or something else?
I got careless and typed 'git checkout file' instead of 'git checkout -- file'
Those commands do the same thing, unless for some reason teh actual name of file
could be confused with a non-path argument to checkout
.
Or to say that differently - the only thing --
does is to separate paths from other options in case it's ambiguous
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With