how to take a single file to a previous commit code example Example: how to commit file to previous commit in git $ git add new-file $ git commit --amend