Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I edit my staged file?

Tags:

I used patch mode to add a file. It took a good while to add only the changes I wanted in this commit. But then I realized I had made a mistake. There was one block of code I don't want in this commit.

Is there a way I can edit the staged change set without changing my working directory and not repeating the long process of git add -up somefile?

like image 215
Gn13l Avatar asked Apr 14 '14 18:04

Gn13l


1 Answers

Yes, just use git reset -p to selectively unstage patches.

like image 84
nneonneo Avatar answered Oct 11 '22 10:10

nneonneo