Git CLI Delete History Commit

  1. Checkout
  2. git checkout --orphan latest_branch
  3. Add all the files
  4. git add -A
  5. Commit the changes
  6. git commit -am "commit message"
  7. Delete the branch

  8. git branch -D master
  9. Rename the current branch to master

  10. git branch -m master
  11. Finally, force update your repository

  12. git push -f origin master