I would appreciate if you help me in this problem I have with git. I am new with working with that. I need to remove untracked change from git. I have already tried "git checkout ." and " git restore .", but those are not working always. Is there any more reliable way? Any help is appreciated.
This is the untracked file I need to be removed from git:
Untracked files:
(use "git add <file>..." to include in what will be committed)
secret1.txt
test-repo % git restore .
test-repo % git status
HEAD detached from V2
Untracked files:
(use "git add <file>..." to include in what will be committed)
secret1.txt
test-repo % git checkout .
Updated 0 paths from the index
test-repo % git status
HEAD detached from V2
Untracked files:
(use "git add <file>..." to include in what will be committed)
secret1.txt
nothing added to commit but untracked files present (use "git add" to track)
As you can see secret1.txt is still there!