Answer the question
In order to leave comments, you need to log in
Why is Git checkout not working?
git status
Result:
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: Main.cpp
git checkout -- Main.cpp
, then git status
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: Main.cpp
Answer the question
In order to leave comments, you need to log in
If you look at diff, then the changes in this file concern only the replacement of CRLF with LF.autocrlf should always be set to false.
I suspect you're using msysgit, which, if you've set it up in the configuration, doesn't see the difference between CRLF and LF, as it will automatically replace CRLF with LF when you commit.
What happens if you do git reset HEAD --hard? Or do you have more than one file changed?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question