Indexlenmiş bir kaç tane dosya var ama, içlerinden bir tanesini committen etkilenmesin diye indexten kaldırmak istiyorsunuz. Dosyanın değişiklikleri olduğu gibi kalıyor. Bu işlem için git reset komutu kullanılır ama "untracked" dosyaları kapsamaz. Daha fazla bilgi için git reset linkini tıklayın.


Mevcut durumu kontrol edelim


inanzzz@inanzzz:~/project$ git status
On branch my-feature-branch
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)

new file: file_seven.txt
modified: file_two.txt

Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)

modified: file_five.txt

Untracked files:
(use "git add <file>..." to include in what will be committed)

file_six.txt

Dosyayı indexten kaldırmak


inanzzz@inanzzz:~/project$ git reset HEAD file_two.txt
Unstaged changes after reset:
M file_five.txt
M file_two.txt

Mevcut durumu kontrol edelim


Göründüğü gibi "file_two.txt" dosyası unindexlenmiş durumda.


inanzzz@inanzzz:~/project$ git status
On branch my-feature-branch
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)

new file: file_seven.txt

Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)

modified: file_five.txt
modified: file_two.txt

Untracked files:
(use "git add <file>..." to include in what will be committed)

file_six.txt