git clone 'VerybadRepo.git' cd VeryBadRepo.git git log (find and copy "commit id" ) git rebase -i "commit id" remove line with unwanted commits ; save and close editor git push -f origin master/main