Using git stash

In this example, we'll explore the git stash command and learn how we can use it to quickly stash away uncommitted changes and retrieve them again. This can be useful when you are interrupted while doing an urgent task and you are not yet ready to commit the work you currently have in your working directory. With the git stash command, you can save the state of your current working directory with/without a staging area and restore the working tree to a clean state.

Get Git Version Control Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.