Git Stash Pop vs Apply: The Difference (and Conflicts)
git stash apply restores your changes and keeps the stash; git stash pop restores them and deletes it, unless there's a conflict. Tested examples, fixes and recovery.
Notes
Security notes, SOC lab write-ups and tested code by Mahir Faysal, a SOC Level 1 cybersecurity learner in Bangladesh, plus notes from my Next.js and Gemini projects. Sample posts are marked and drafts stay in the admin area.
git stash apply restores your changes and keeps the stash; git stash pop restores them and deletes it, unless there's a conflict. Tested examples, fixes and recovery.
Stop tracking a file in Git without deleting it: git rm --cached, .gitignore, whole folders, a dry run, undoing it, and the catch for teammates and secrets.
Undo your last Git commit and keep the changes with git reset --soft HEAD~1, plus mixed, hard, reflog recovery, --amend and revert, each run on a real repo.
0%