🔧 Error Fixes

git stash pop CONFLICT — How to Fix Stash Merge Conflicts


Auto-merging src/app.js
CONFLICT (content): Merge conflict in src/app.js

You ran git stash pop and the stashed changes conflict with your current working tree. The stash was applied but not dropped (it’s still in the stash list).

Step 1: Resolve the Conflicts

Open the conflicted files. They’ll have the standard conflict markers:

<<<<<<< Updated upstream
const port = 8080;
=======
const port = 3000;
>>>>>>> Stashed changes

Edit the file to keep what you want:

const port = 3000;

Step 2: Stage the Resolved Files

git add src/app.js

Step 3: Drop the Stash

Since git stash pop failed, the stash wasn’t dropped. Drop it manually:

# Check it's still there
git stash list

# Drop it
git stash drop

If You Want to Abort

Changed your mind? Undo the stash pop entirely:

git checkout -- .
# or
git restore .

Your stash is still intact (it wasn’t dropped because of the conflict).

Prevention Tips

# Check what's in the stash before popping
git stash show -p

# Use apply instead of pop (safer — doesn't auto-drop)
git stash apply

# Stash with a name so you remember what it is
git stash push -m "WIP: login feature"

# Create a branch from stash (avoids conflicts)
git stash branch new-branch

See also: Git merge conflict fix