DEV Community

baris
baris

Posted on

Answer: git remove file from stash, nice workaround

There is a workaround for this situation:

  1. save your stash as a patch file:

    $ git stash show -p > stash.patch
    
  2. apply this patch, skipping the conflicts (you will be asked for resolution of conflicts, just skip missing files):

    $ patch -p1 < stash.patch
    

Don't forget to clean up stash.patch

Top comments (0)