This work for me :
git config --global user.name "Correct Name"
git config --global user.email name@email.com
git commit --amend --reset-author
it will show the screen where you can edit the commit message, after edit or keep it as it is, then press escape and then :wq and hit enter
git push