If you're using git-credential-cache as helper (to store passwords in memory), simply use:
git-credential-cache
git credential-cache exit
It will effectively wipe git-credential memory cache so you can re-enter your credentials upon next push / pull.
Source: https://git-scm.com/docs/git-credential-cache/2.8.6