Rewrite History With Git

edit✏️

Unstage learning-python-debugger


git reset -- <file>

rage unstage to wipte out history of staged commit


git reset --hard <file>

Undo file

undo n commits back

locally before push


git reset HEAD~n

after push


git revert HEAD~n

update .gitignore

after push


git rm -r --cached .
git commit -am "Updated .gitignore"