I have this problem constantly - the only thing that works is:
git rm --cached -r . > /dev/null # redirect if output is huge
git reset --hard
but make sure you have no changes you want to keep
See git line endings - can't stash, reset and now can't rebase over spurious line endings commit
Someone must make a example repo that exhibits this behavior and post it to the git tracker - this is a bug (in the sense that git reset --hard
and co should work immediately)
EDIT: make sure you have read the required reading and set up a .gitattributes
file