Nicholas Chmielewski
2014-10-15 04:34:12 UTC
git version 1.9.1 & version 2.1.2
I had some changes in a tracked file that I wanted to discard.
Instead of using checkout, I instead used `git reset --hard HEAD` to reset.
Git returned the message `HEAD is now at <sha> <commit-message>`
I then went `git status` and it showed me that I still have changes to commit
I expected there to be no changes in my working directory as a result of
doing a `git reset --hard`
I did a little more fiddling around and still yielded the same results.
- `$ touch file.md`
- `$ git add file.md`
- `$ git commit -m 'empty file'`
- `$ echo 'text' > file.md`
At this point git reported that I had uncommited changes for both file.md and
the troublesome file in question (jquery.datatables.js)
`$ git reset --hard HEAD`
Git now no longer reports and untracked changes for file.md but still
for jquery.datatables.js
`$ git reset --hard HEAD~1`
Git still reports untracked changes for jquery.datatables.js
I have included a copy of the diff of the jquery.datatables.js
I had some changes in a tracked file that I wanted to discard.
Instead of using checkout, I instead used `git reset --hard HEAD` to reset.
Git returned the message `HEAD is now at <sha> <commit-message>`
I then went `git status` and it showed me that I still have changes to commit
I expected there to be no changes in my working directory as a result of
doing a `git reset --hard`
I did a little more fiddling around and still yielded the same results.
- `$ touch file.md`
- `$ git add file.md`
- `$ git commit -m 'empty file'`
- `$ echo 'text' > file.md`
At this point git reported that I had uncommited changes for both file.md and
the troublesome file in question (jquery.datatables.js)
`$ git reset --hard HEAD`
Git now no longer reports and untracked changes for file.md but still
for jquery.datatables.js
`$ git reset --hard HEAD~1`
Git still reports untracked changes for jquery.datatables.js
I have included a copy of the diff of the jquery.datatables.js