Rewrite History with Git ━━━━━━━━━━━━━━━━━━━━━━━━ git commit --amend Date: February 5, 2019 - rebase - git commit –amend Unstage ─────── Terminal bash ``` git reset -- ``` rage unstage to wipte out history of staged commit Terminal bash ``` git reset --hard ``` Undo file ───────── - rage quit - git reset HEAD~n removes modifications keeps hitsory of changes and undoes them - git checkout HEAD~n – keeps modifications removes history –SOFT –HARD –Mixed undo n commits back ─────────────────── locally before push Terminal bash ``` git reset HEAD~n ``` after push Terminal bash ``` git revert HEAD~n ``` update .gitignore ───────────────── after push Terminal bash ``` git rm -r --cached . git commit -am "Updated .gitignore" ```