ItSolutionStuff.com

How to Revoke 'git add' Before 'git commit' Command?

By Hardik Savani • January 31, 2023
Git

Sometimes you need to undo your git file before you git comment command. Because you made a some wrong code and you did git add using "git add ." command then you think how to undo your code before git commit command. But you can do that using git reset command, if you need to undo all file Or you may need to undo just one then you can do using git reset command, you can see bellow command.

You can try following commands:

Command 1: For Specific File

git reset

Command 2: For All Files

git reset

I hope it can help you

Tags: Git
Hardik Savani

Hardik Savani

I'm a full-stack developer, entrepreneur, and founder of ItSolutionStuff.com. Passionate about PHP, Laravel, JavaScript, and helping developers grow.

📺 Subscribe on YouTube

We Are Recommending You

How to Remove File from Git Commit Before Push?

Read Now →

How to Delete a Branch form GitHub Repository?

Read Now →

How to Rename Branch Name in Git Command?

Read Now →

How to Switch Branch using Git Command?

Read Now →

How to Create a New Branch on GitHub?

Read Now →

How to Clone Github Repository using Command Line?

Read Now →

How to Ignore Wildcard Files Name in Git using Gitignore?

Read Now →

How to Ignore Folder in Git using Gitignore?

Read Now →

How to Ignore File in Git using Gitignore?

Read Now →

How to Git Ignore Some Files Locally?

Read Now →

How to Add Git Add Remote Origin on Bitbucket Repository?

Read Now →

Git - How to Find a Deleted File in Commit History?

Read Now →

How to Configure Git Username and Email?

Read Now →