DEV Community

Discussion on: Git hacks you should know about

Collapse
 
vinagreti profile image
Bruno João

git commit --amend can be use to add new modifications to the previous commit.

You can edit a file and mark it to commit

    git add .

and then

    git commit --amend

to insert the modifications in the previous commit.