If you want to change commit message after commit, you can do this by:
git rebase --interactive '^'
With this rebase you want edit your commit comment, after that commit your changes:
git commit --all --amend --no-edit
At last go on with your rebase to finish it:
git rebase --continue
To get back to the HEAD.
SHA-1 of the commit changes, so be creaful by pushing your commits. Don't use git push --fore
This problem is caused by windows saving credentials, like a password manager. Once you login to github via Intellij these credentials are saved in windows and everytime you connect to your github account it will use the saved credentials instead of the written ones. To remove the credentials in windows go to Control Panel, then click on User Accounts. In this window click on Credential Manager, the git credentials should be under Windows Credentials. Find the credentials that you need, click on them and then click on remove.
You can also remove files from the repository based on your .gitignore without deleting them from the local file system :
git rm --cached `git ls-files -i -X .gitignore`
Or, alternatively, on Windows Powershell:
git rm --cached $(git ls-files -i -X .gitignore)
Usually many code editors today are using a git plugin that you can use. Try to find if there is an intergrated Git versioning system in your code editor. Personally would reccoment for Mac using the Visual Studio Code which has git integrated