If the git status command displays 'myfile.txt' as file pending to commit then To unstage a file(which is not yet committed but in staging stage); command 'git reset ' is used. After using 'git reset HEAD myfile.txt' command; 'git status' command will not show myfile.txt in the list of files pending to commit, now it will be displayed under the list of the unstage/untracked files.   Now to discard the changes('myfile.txt') in working directory; command 'git checkout -- is used. After using 'git checkout -- myfile.txt' command; 'git status' command will not show myfile.txt in the list of unstage/untracked files as this file 'myfile.txt' will be replaced with the last committed version from the repository.