Git: how to revert back the last commit?

how to revert to last commit magento 2
We have all been there where we had to revert back our last commit from GIT, so below is the simple command to revert back your last commit -:

git reset --soft HEAD~1

The above command will only revert back your last commit but it will keep the file(s) and folder(s) intact so that you can either replace them with previous version or make further changes to the file(s) or folder(s)

Hope this article helped you in some way. Please leave us your comment and let us know what do you think? Thanks.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.