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
Apache (5)
CSS (3)
Docker (6)
Git (5)
Go (1)
Hobbies & Toys (8)
HTML (4)
Javascript (5)
jQuery (3)
Linux Ubuntu (46)
Misc (36)
MySQL (3)
Odoo (13)
PHP (3)
Pipeline (1)
Postgresql (6)
Python (13)
Quote (1)
Qweb (1)
Random Word (1)
Smartphone (1)
SQL Server (1)
Tools (7)
Useful Links (46)
Video (3)
VLC (1)
Vue (1)
Web Server (3)
zuka.one
©2011