Kategori : Git, Linux Ubuntu14 Januari 2020 10:55:11

Git Cancel Local Commit

If you want to just cancel commit, you can use this script bellow :

git reset HEAD~1

But if you want to cancel and discard all changes, you can add flag --hard, this flag will also make git discard all changes you made.

git reset --hard HEAD~1

Source : https://stackoverflow.com/questions/4850717/how-to-cancel-a-local-git-commit

Share : Share Facebook Share Twitter
Kategori : Git, Linux Ubuntu14 Januari 2020 10:55:11

zuka.one
©2011