Custom only new files using Git

I accidentally made a lot of changes, including new files that I do not want to make.

How can I disable or reset only new files?

I am not looking for a single script; I am looking for the basic git functionality that will be revealed and documented here on SO under a meaningful topic heading.

+6
source share
1 answer

One way you can do this is to disable / reset everything, and then rebuild only what you wanted:

git reset HEAD ./ git add -u # -u stages changes to tracked files, and will not stage new files. 
+6
source

Source: https://habr.com/ru/post/971305/


All Articles