I am using git, I added some files its showing those files in the modified list. I did git diff on that same file and found some unintentional changes like addition of newline were also there in the file.
To get rid of the unintentional changes I did git checkout -- and just copied only those changes back to the file and before doing git add I again did git diff on the same file it showed the same git diff status which it had shown when I first did the git diff with all the unintentional changes.
How to get out of this?