---
title: "Discussion on \"Add More Files and Changes to a Commit Before Pushing\" | Hashnode"
description: "Discussion on \"Add More Files and Changes to a Commit Before Pushing\". After creating new files and editing existing files, we want to add them to the previous commit i.e. rewrote the previous commit.\nFirst, add all the files to the staging area.\ngit commit -A\n\nNow, commit them using the --amend flag.\ngit commit --amend..."
url: "https://hashnode.com/posts/add-more-files-and-changes-to-a-commit-before-pushing/64857b6e677eb9f1e85b345e"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Add More Files and Changes to a Commit Before Pushing](https://sksundram.site/add-more-files-and-changes-to-a-commit-before-pushing?utm_source=hashnode&utm_medium=feed)

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 --amend flag. git commit --amend...

Jun 11, 2023 · 1 min read · sksundram.site  
Updated Mar 7, 2024  
Read the article

-   [#git](https://hashnode.com/tag/git)
-   [#tips](https://hashnode.com/tag/tips)

## Written by

[Shailesh Kumar Sundram](https://hashnode.com/@sksundram)

@sksundram · Bengaluru, India

  
[View profile](https://hashnode.com/@sksundram)

Full-stack developer

Terminal &amp; Vim aficionado

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
