Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git in PHPstorm: Unstage files from Git (remove uncommited files from stage)

In PHPStorm's Git interface it's easy to stage files and folders, with the "+Add" option in the "Git >" submenu of the right click context menu. But, how do I remove them from stage?

like image 413
OMA Avatar asked Aug 07 '14 20:08

OMA


1 Answers

I've found an easy (but not obvious) way to remove files from Git in PHPStorm (or any other IntelliJ based IDE) when they still haven't been committed (for example, you "add"/stage some files which will finally not be used).

You just have to right click the file and select "Git > Revert". Since it's still not commited, "reverting" will actually "remove"/unstage the file from Git.

You even have the option to physically remove the file by checking the "Delete local copies of added files" option, or just leave it as it is after removing it from Git by leaving that option unchecked (in that case the file will be shown in red as if it still hadn't been added).

like image 167
OMA Avatar answered Sep 21 '22 06:09

OMA