diff --git a/git.md b/git.md index 7a4ccd1..7449d3a 100644 --- a/git.md +++ b/git.md @@ -7,6 +7,7 @@ - [branches](#branches) - [create a branch](#create-a-branch) - [submodules](#submodules) +- [stash](#stash) - [removing files from index](#removing-files-from-index) - [philosophies](#philosophies) - [merge](#merge) @@ -53,6 +54,13 @@ git submodule update --init --recursive ``` +## stash + +If the current tree is dirty, one can use `git stash` to temporarily save the changes and reset the tree to the last commit. +Afterwards the changes can be reapplied with `git stash pop`. +This can be useful if for example one would like to create a new branch for the current changes. + + ## removing files from index To remove files from index without deleting them on disk, use: