- You can use the squash
- BFG
- Move HEAD back to previous commit (link)
squash
# edit all the commits up to the given sha-1
git rebase -i <sha-1>

but one of the file being very large my push command fails...
How to remove big files from the repository
You can use git filter-branch
or BFG.
https://rtyley.github.io/bfg-repo-cleaner/
BFG Repo-Cleaner
an alternative to git-filter-branch.
The BFG is a simpler, faster alternative to git-filter-branch for cleansing bad data out of your Git repository history:
* Removing Crazy Big Files*
* Removing Passwords, Credentials & other Private data
Examples (from the official site)
In all these examples bfg is an alias for java -jar bfg.jar.
# Delete all files named 'id_rsa' or 'id_dsa' :
bfg --delete-files id_{dsa,rsa} my-repo.git
