You could add the following commands - git reset --soft HEAD~1 - used to revert the last commit and retain the changes when changes aren't pushed - git reset --hard HEAD~1 - used to revert the last commit and discard the changes when changes aren't pushed