I was writing a simple script in the school computer, and committing the changes to Git (in a repo that was in my pendrive, cloned from my computer at home). After several c
If the commits you want to fix are the latest ones, and just a couple of them, you can use a combination of git reset
and git stash
to go back an commit them again after configuring the right name and email.
The sequence will be something like this (for 2 wrong commits, no pending changes):
git config user.name
git config user.email
git reset HEAD^
git stash
git reset HEAD^
git commit -a
git stash pop
git commit -a