I am working with SourceTree and I would like to reset all changes I have made in my working copy.
For some tests, I created three Java class files, a new one, one which I have updated and a last one which I have removed from my working copy:
New.java
Update.java
Remove.java
Reset All works fine for the updated and the deleted class file but not for the new one:
After the reset I have to remove the New.java
class manually:
Summarized:
After Reset All the updates on the Update.java
file were gone and the removed Remove.java
file were restored. Perfect! The only thing I didn't understand is why I have to remove the new New.java
file manually? Could it be that I have some missunderstanding?
Thanks in advance!
If New.java is a new file that has never been staged, git reset would never delete that file as git does not know what to do with it. Effectively, New.java is an untracked file and git won't do anything to this file until you add it to the stage.