Git

Remove leftovers after remote branch deletion

git remote prune origin

Undo/roll-back changes

git revert (not rewriting history / full disclosure)

Undo one or more commits in a next commit:

git revert HEAD~3..HEAD

Git revert <old-commit>..<new-commit>

git reset (rewriting history / obfuscation)

Vanilla

Go back to a previous state and DELETE all commits that were made after that status:

git reset --hard <the-commit-to-be-reset-to>
Remote state

Go back to the current REMOTE state and DELETE all commits that were made after that status, provided that the remote repository is origin, and that you're interested in master:

git fetch origin
git reset --hard origin/master