Undo most recent commit both locally and remotely
13-09-2022
When to use reset:
git reset --hard HEAD^
git push -f- the
resetcommand changes the commit history and it might overwrite history that remote team members depend on - use the
resetcommand if the commit being reset only exists locally
When to use revert:
git revert <COMMIT>
git push- the
revertcommand creates a new commit that undoes the changes - use the
revertcommand if the commit being reset has been pushed to the remote