After creating new files and editing existing files, we want to add them to the previous commit i.e. rewrote the previous commit.
First, add all the files to the staging area.
git commit -A
Now, commit them using the
git commit --amend -m "Adding index.html and app.js"