How to undo last commit Git

I got the tutorial from stackoverflow again. I just want to take the solution here so that I can easily search it.


This is the answer that I have tried :

If you want to permanently undo it and you have cloned some repository
The commit id can be seen by
git log 
Then you can do -
git reset --hard <commit_id>

git push origin <branch_name> -f

Popular posts from this blog

Fixing Keyboard Hide When Reload UITableview iOS swift 5

How to have ConstraintLayout inside ScrollView and ScrollView inside ConstraintLayout Android

Create Smooth Dropdown on iOS swift 5