git stash يحفظ تعديلاتك غير المكتملة مؤقتًا، دون عمل commit، ويعيد الملفات إلى حالة آخر commit.
متى أحتاجه؟
تعمل على ميزة، وفجأة تحتاج إصلاح خطأ عاجل في فرع آخر. لا تريد عمل commit لشيء غير مكتمل:
git stash # put the changes aside
git switch main # fix the urgent bug...
git switch feature
git stash pop # bring the changes back
أوامر مفيدة
git stash push -m "half-done form" # with a note
git stash list # see saved stashes
git stash drop # delete the latest one
الـ stash محلي على جهازك، ولا يُرفع مع git push.