diff --git a/README.md b/README.md index 2cff35a..171f15a 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,9 @@ For clarity's sake all examples in this document use a customized bash prompt in - [I pulled from/into the wrong branch](#i-pulled-frominto-the-wrong-branch) - [I want to discard local commits so my branch is the same as one on the server](#i-want-to-discard-local-commits-so-my-branch-is-the-same-as-one-on-the-server) - [I want to discard my local, uncommitted changes](#i-want-to-discard-my-local-uncommitted-changes) +- [I want to move my unstaged edits to a new branch](#i-want-to-move-my-unstaged-edits-to-a-new-branch) +- [I want to move my unstaged edits to a different, existing branch](#i-want-to-move-my-unstaged-edits-to-a-different-existing-branch) +- [What did I just do?](#what-did-i-just-do) - [I want to add changes in one file to two different commits](#i-want-to-add-changes-in-one-file-to-two-different-commits) - [I want to remove a file from git but keep the file](#i-want-to-remove-a-file-from-git-but-keep-the-file) - [Clone all submodules](#clone-all-submodules) @@ -444,6 +447,22 @@ If you want to only reset to some commit between origin and your local, you can (master)$ git checkout -f ``` + +## I want to move my unstaged edits to a new branch + +```sh +$ git checkout -b new-branch +``` + + +## I want to move my unstaged edits to a different, existing branch + +```sh +$ git stash +$ git checkout branch2 +$ git stash pop +``` + ## What did I just do?