Does a git hard reset remove stash?

Issue

Just wanted to understand if the git reset --hard origin/master command affect my stash stack. I am yet to try this out but I do not want it to reset my stash as I have some changes I want to apply after my branch is reset.

Solution

The hard reset command you showed above would move the HEAD pointer of whatever the current branch might be to origin/master, but it would not affect the stash commits, which are stored in .git/refs/stash.

Answered By – Tim Biegeleisen

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published