# 🇬🇧 05 — Deleting files and directories Nothing is ever truly lost: a deletion is just another commit, and the old content stays in the history. ## Deleting one file 1. Open the file. 2. Press the **…** menu at the top right of the file view. 3. Choose **Delete this file** (or use the 🗑️ icon next to the edit pencil). 4. Write a commit message and press **Commit Changes**. ## Deleting a folder 1. Open the folder. 2. Press the **…** menu next to *Add File*. 3. Choose **Delete this directory**. 4. Commit. Everything inside the folder is removed in that single commit. ## Deleting several files at once The browser deletes one path at a time. For a large clean-up, work from your computer (chapter 10): ```bash git rm -r old-folder git commit -m "remove old folder" git push ``` ## Getting a deleted file back 1. Open **History** on the folder that used to contain it, or the repository history. 2. Find the commit *before* the deletion. 3. Open the file at that commit and copy the content, or press **Browse source at this point** and recreate it. Anything that was ever committed can be recovered. Something you typed in the editor but never committed cannot. ## Careful with - **Deleting the folder instead of the file** — check the menu title says *file* when you mean one file. - **Protected branches** — if `main` is protected, deletion goes through a pull request instead (chapter 09). - **Secrets** — deleting a password from a file does *not* remove it from the history. Change the password itself. --- # 🇹🇷 05 — Dosya ve dizin silme Hiçbir şey gerçekten kaybolmaz: silme de bir işlemedir ve eski içerik geçmişte durur. ## Tek dosya silme 1. Dosyayı açın. 2. Dosya görünümünün sağ üstündeki **…** menüsüne basın. 3. **Bu dosyayı sil**'i seçin (ya da düzenleme kaleminin yanındaki 🗑️ ikonunu kullanın). 4. Bir işleme mesajı yazıp **Değişiklikleri Uygula**'ya basın. ## Klasör silme 1. Klasörü açın. 2. *Dosya Ekle*'nin yanındaki **…** menüsüne basın. 3. **Bu dizini sil**'i seçin. 4. İşleyin. Klasörün içindeki her şey o tek işlemede kaldırılır. ## Aynı anda birden çok dosya silme Tarayıcı tek seferde tek yol siler. Büyük temizlik için bilgisayarınızdan çalışın (bölüm 10): ```bash git rm -r eski-klasor git commit -m "eski klasör kaldırıldı" git push ``` ## Silinen dosyayı geri getirme 1. Dosyanın bulunduğu klasörde **Geçmiş**'i ya da depo geçmişini açın. 2. Silmeden *önceki* işlemeyi bulun. 3. Dosyayı o işlemede açıp içeriği kopyalayın veya **Bu noktadaki kaynağa göz at** ile yeniden oluşturun. Bir kez işlenmiş her şey geri getirilebilir. Editöre yazıp hiç işlemediğiniz bir şey getirilemez. ## Dikkat edilecekler - **Dosya yerine klasörü silmek** — tek dosya kastediyorsanız menü başlığının *dosya* dediğine bakın. - **Korumalı dallar** — `main` korumalıysa silme, değişiklik isteğiyle ilerler (bölüm 09). - **Sırlar** — bir parolayı dosyadan silmek onu geçmişten *kaldırmaz*. Parolanın kendisini değiştirin.