xxxxxxxxxx
# BEFORE PUSH
git reset --soft HEAD~
# Add number to the end for multiple commits. e.g
git reset --soft HEAD~2
xxxxxxxxxx
# Find the commit hash of the commit you want to revert
git log
# Revert the commit using its hash
git revert <commit-hash>
# Push the revert commit to the remote repository
git push origin <branch-name>
xxxxxxxxxx
#Reset author for the current repo:
git config --local user.name "Alex Smith"
git config --local user.email alex@email.com
#Now reset the author of your commit without edit required:
git commit --amend --reset-author --no-edit
#Force push your changes without overwriting anyone else's commits:
git push --force-with-lease