Switched accounts in Github Desktop but commits are showing up as old account

I logged out through github desktop from Account A and in with Account B. However I just noticed that commits to my repository owned by Account B are shown as from Account A.

How can I fix this so they show from Account B? Is there anyway to retroactively change the owner of the commits?

(I’m new to this so I am not sure I am using the terms correctly)

You’ll have to update your author email address, which Github uses to assign commits to an account. You might want to also update your author name to match. Note that you can set these globally, but you can also override the global value for a particular repository, which might be useful if you use different identities for different repositories.

You can change past commits by rewriting history. Note that this will make things complicated for anyone you have shared the repository with, they will have to manually accept the change. Depending on how many commits you want to change you might either used git rebase -i and edit each commit in turn, or use a bulk approach with git filter-branch (described at the end of the article linked below).