Try   HackMD

To manage multiple stashes and selectively apply or drop specific changes from a stash, you can use the following steps [1][2]:

Managing Multiple Stashes:

  1. Stash Changes: Whenever you want to save your current work without committing, use the git stash command.
    ​​​​git stash save "Your stash message"
    
    This command stashes your changes, creating a new stash with a message that describes the changes you stashed.
  2. List Stashes: You can list your stashes using git stash list. This command shows all your stashes and their descriptions.
  3. Apply Stash: To apply the changes from a stash, you can use git stash apply followed by the stash reference (e.g., stash@{1}).
    ​​​​git stash apply stash@{1}
    
  4. Pop Stash: If you want to apply the changes and remove the stash at the same time, use git stash pop
    ​​​​git stash pop stash@{1}
    
  5. Drop Stash: To remove a stash without applying it, you can use git stash drop.
    ​​​​git stash drop stash@{1}
    

Selectively Applying or Dropping Changes from a Stash:
When you want to apply or drop specific changes from a stash, you can use the following steps:

  1. Apply Stash as a Branch: Use git stash branch to create a new branch and apply a stash to it. This allows you to work on the changes separately.
    ​​​​git stash branch new-branch-name stash@{1}
    
  2. Inspect Changes: After creating the branch, inspect the changes by using a diff tool or by manually reviewing the files.
  3. Apply or Drop Individual Changes: Apply or drop specific changes using Git's regular commands. You can use git cherry-pick, git checkout, and git reset to apply or remove individual commits or file changes.
  4. Commit Changes: Once you've selected the changes you want to keep, commit them to the branch using git commit.
  5. Manage the Stash: After you've applied or dropped specific changes, you can manage the stash as needed. You can choose to keep it for later or drop it if you no longer need it.

By selectively applying or dropping specific changes from stashes, you can effectively manage your work, especially when dealing with complex feature branches or when you need to switch between tasks. This approach allows you to keep your workspace clean and organized while still having the flexibility to work on different sets of changes separately.