how to revert the last commit in git in windows code example Example 1: roll back last commit in git Click to copygit reset --soft HEAD~1 Example 2: revert last commit Click to copygit reset HEAD~