Skip to content

Commit 39c073e

Browse files
committed
Create new article and reusables
1 parent ee06d28 commit 39c073e

3 files changed

Lines changed: 55 additions & 0 deletions

File tree

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
title: Stashing changes
3+
intro: You can stash changes to temporarily save them without committing them to a branch.
4+
versions:
5+
free-pro-team: '*'
6+
---
7+
8+
### About stashed changes
9+
You can view and make commits to any of your repository's branches. If you have uncommitted, saved changes, you'll need to decide what to do with your changes before you can switch branches. You can commit your changes on the current branch, stash your changes on the current branch, or bring the changes to your new branch. If you want to commit your changes on the current branch, follow the steps in "[Committing and reviewing changes to your project](/desktop/contributing-to-projects/committing-and-reviewing-changes-to-your-project)" before switching branches.
10+
11+
You can stash all uncommitted changes to temporarily save the changes without committing them, and then reapply the changes later. You can only stash one set of changes at a time with {% data variables.product.prodname_desktop %}. After you stash changes on a branch, you can safely change branches or make other changes to your current branch.
12+
13+
### Stashing changes
14+
15+
{% data reusables.desktop.click-changed-files-header %}
16+
{% data reusables.desktop.click-stash-all-changes %}
17+
18+
### Switching between branches
19+
20+
{% tip %}
21+
22+
**Tip**: You can set a default behavior for switching branches in the **Advanced** settings. For more information, see "[Configuring basic settings](/desktop/getting-started-with-github-desktop/configuring-basic-settings)."
23+
24+
{% endtip %}
25+
26+
{% data reusables.desktop.current-branch-menu %}
27+
{% data reusables.desktop.switching-between-branches %}
28+
![List of branches in the repository](/assets/images/help/desktop/click-branch-in-drop-down-mac.png)
29+
3. If you have saved, uncommitted changes, choose **Leave my changes** or **Bring my changes**, then click **Switch Branch**.
30+
![Switch branch with changes options](/assets/images/help/desktop/stash-changes-options.png)
31+
32+
### Retrieving stashed changes
33+
To access changes you've stashed in another branch, switch back to the branch you stashed the changes in.
34+
35+
{% data reusables.desktop.current-branch-menu %}
36+
{% data reusables.desktop.switching-between-branches %}
37+
![List of branches in the repository](/assets/images/help/desktop/click-branch-in-drop-down-mac.png)
38+
3. In the left sidebar, click **Stashed Changes**.
39+
![Stashed changes option](/assets/images/help/desktop/stashed-changes.png)
40+
4. To delete your stashed changes, click **Discard**, or to use your stashed changes, click **Restore**.
41+
![Discard or Restore stashed changes](/assets/images/help/desktop/discard-restore-stash-buttons.png)
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
1. Right click the **changed files** header.
2+
{% mac %}
3+
![The changed files header](/assets/images/help/desktop/mac-changed-file-header.png)
4+
{% endmac %}
5+
{% windows %}
6+
![The changed files header](/assets/images/help/desktop/windows-changed-file-header.png)
7+
{% endwindows %}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
1. Click **Stash All Changes**.
2+
{% mac %}
3+
![The Stash All Changes menu item](/assets/images/help/desktop/mac-stash-all-changes.png)
4+
{% endmac %}
5+
{% windows %}
6+
![The Stash all changes menu item](/assets/images/help/desktop/windows-stash-all-changes.png)
7+
{% endwindows %}

0 commit comments

Comments
 (0)