How to apply stashed changes in Git

Applying stashed changes in Git restores previously saved work to the working directory while preserving the stash for potential future use. As the creator of CoreUI with over 25 years of experience managing complex development workflows, I’ve applied stashed changes countless times when switching between features and managing multiple work streams. From my expertise, the most reliable approach is using git stash apply to restore changes without removing them from the stash list. This command provides safe change restoration that allows reverting if the applied changes conflict with current work.

Use git stash apply to restore stashed changes to the working directory while keeping the stash in the stash list.

git stash apply

Here git stash apply restores the most recent stash to the current working directory without removing it from the stash list. This allows you to apply the same changes multiple times or to different branches if needed. If you have multiple stashes, use git stash apply stash@{1} to apply a specific stash by index. The command merges the stashed changes with your current working directory, potentially creating merge conflicts that need to be resolved manually.

Best Practice Note:

This is the same approach we use in CoreUI development when we need to test stashed changes across multiple branches or when we’re unsure if the restored changes will work correctly. Use git stash apply when you want to keep the stash for potential future use, or git stash pop when you’re certain you won’t need the stash again.


Speed up your responsive apps and websites with fully-featured, ready-to-use open-source admin panel templates—free to use and built for efficiency.


About the Author