How it works...

We have created two commits: one for the index and one for the work area. In gitk, we can see the commits that stash creates to put the changes away (gitk stash), as shown in the following screenshot:

We can also see the state of the branches after we created the commit (gitk --reflog), as shown in the following screenshot:

Git actually creates two commits under the refs/stash namespace. One commit contains the contents of the staging area. This commit is called index on master. The other commit is the work in progress in the ...

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.