Say I have 5 files: (file1, file2, ... file5).
All have been commited.
Say now all 5 files have been changed.
When you issue git status, all 5 files should be shown as (red) unstaged status.
Say I am happy with the changes in file1 to file4, but not file5 (i.e. I'd like to revert file5 to the last committed stage).
To do this:
Stage all 5 files
git add .
Unstaged file5
git reset file5
Stage file5
git stash --keep-index
Now, file5 is back to original commited stage.
References:
Stackoverflow forum - Stash only one file out of multiple files that have changed with Git
Worked Perfectly Thanks