Delete the last commit, if it hasn't been pushed.
git reset --soft HEAD~1
Delete the last commit, if it has been pushed.
git reset --hard HEAD~1
git push origin HEAD --force
Temporarily ignore local changes to a file
#!/bin/sh | |
# Credits to: | |
# - http://vstone.eu/reducing-vagrant-box-size/ | |
# - https://github.com/mitchellh/vagrant/issues/343 | |
# - https://gist.github.com/adrienbrault/3775253 | |
# Unmount project | |
umount /vagrant |
Delete the last commit, if it hasn't been pushed.
git reset --soft HEAD~1
Delete the last commit, if it has been pushed.
git reset --hard HEAD~1
git push origin HEAD --force
Temporarily ignore local changes to a file