Git commands to remove latest commitUpdated: 12th April 2021Tags: gitRemove commit but save current codegit reset --soft HEAD~1 git push origin master --force Remove commit and remove commit’s codegit reset --hard HEAD~1 git push origin master --force