I would like to know how to delete a commit.
By delete
, I mean it is as if I didn\'t make that commit, and when I do a push in the future, my changes wi
As you can see on above image i want to delete revert"test change 2" commit(SHA1 ID: 015b5220c50e3dfbb1063f23789d92ae1d3481a2(you can get SHA1 ID by using gitk
command in git bash)).
For that i can use(all below command work on local only. you need to push after delete):
git reset --hard 515b5220c50e3dfbb1063f23789d92ae1d3481a2
//it back-up you to that commit (SHA1 ID of test change 4 commit is 515b5220c50e3dfbb1063f23789d92ae1d3481a2) git reset --hard HEAD~1
// it back-up you before one commit.git reset --hard HEAD^
// To remove the last commit from gitafter delete: