It will revert the commit but keep the changes
git reset --soft HEAD~1
Create new branch
git reset HEAD index.js
It unstage a staged file.
git reset --hard HEAD~1
It will revert the commit and remove the changes