git rm --cached; git add; git status Stop tracking a file. Cached option removes it from the git repo but keeps it in the working directory.

git revert --no-commit <hash>..HEAD
git commit
git push

This walks back every commit from the HEAD until and not including <hash>.

git checkout <branch>
git reset --hard <branch>

if you want to get rid of all your local changes on <branch>

git push/pull -u <repo_name> <branch_name>

e.g git pull -u origin prod to pull the origin/prod branch into this local branch that i’ve checked out