The only way to clear this diff is by force pressing. If several people are working on the same branch, it is best to let them know that you are rewriting a story.
Assuming this was your last commit ...
git reset
(undo password changes)
git diff
(make sure there are no changes that display the passwords)
(stage/commit changes)
git push origin +branch_name
Following standard precautions, I would also reset these passwords if they are associated with sensitive data ...
source
share