Git remove last commit from local

Share Me
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  

Today now in this post i will show you how to remove last commit from git on locally. We know that git is distributed version and control system that is a awesome. when ever we are working with git repository. if we did commit our any code in our local system by mistake, then also if we want to remove last commit from our project. so let’s see the following example for remove:

Example:

git add .
git commit -m "change for test"
git reset --soft HEAD~

Read Also : How to remove specific value from php array?

Thanks for read. I hope it help you. For more you can follow us onĀ facebook.

About code chef

My name is Shahriar sagor. I'm a developer. I live in Bangladesh and I love to write tutorials and tips that will help to other Developer's. I am a big fan of PHP, Javascript, JQuery, Laravel, Codeigniter, VueJS, AngularJS and Bootstrap from the early stage.

View all posts by code chef →