GitKraken Desktop Documentation

Detached HEAD in GitKraken Desktop

Last updated: March 2026

Use this page to enter, work in, and recover from detached HEAD state in GitKraken Desktop when you need to inspect or test a specific commit without switching a branch pointer. It explains how to preserve commits created in detached HEAD state and how to recover lost work if you switch branches too early.

Requirements and limits

  • Entry point: Check out a specific commit instead of a branch
  • HEAD behavior: The checked-out commit is labeled HEAD
  • Commit-preservation rule: Commits made in detached HEAD state are not attached to any branch until you create one
  • Exit behavior: Checking out another branch removes the detached HEAD state
  • Recovery options: Use GitKraken Desktop Undo if available, or use git reflog from the terminal to recover lost commit SHAs
  • Risk: Unpreserved commits can be lost from normal branch history when you switch branches

Quick Start

To enter detached HEAD state:

  1. Right-click any commit in the Commit Graph.
  2. Select Checkout this commit. The commit will display a HEAD label.

To preserve commits made in detached HEAD state:

  1. Right-click the commit labeled HEAD.
  2. Select Create branch here and name the new branch.

To exit detached HEAD state:

  • Double-click any local branch in the graph or Left Panel to check it out.

Any commits made in detached HEAD state that were not saved to a branch will be removed when you switch branches. If you switch branches before creating a branch, use the Undo button if available, or run git reflog in the terminal to find the lost commit SHA and re-check it out with git checkout <SHA>.


How to enter detached HEAD state

  1. Right-click the commit you want to inspect.
  2. Select Checkout this commit.
Context menu showing 'Checkout this commit' option in GitKraken Desktop after right-clicking a specific commit in the graph view
Check out any past commit without creating a new branch.

The checked-out commit will display a HEAD label, indicating you’re in detached HEAD state.

GitKraken Desktop showing HEAD label attached to a specific commit in the graph, indicating the currently checked-out commit
GitKraken tags the commit with HEAD.

You can now review the full history and diffs, or create a branch from this state.


How to commit in detached HEAD state

You can make changes and commit them while in this state. However, these commits won’t belong to any branch.

GitKraken Desktop interface showing a warning banner that says 'You are in a detached HEAD state' above the commit panel with unstaged changes listed
GitKraken shows a warning when you commit in detached HEAD state.

To preserve your work, create a branch from the current commit:

  1. Right-click the commit tagged as HEAD.
  2. Select Create branch here.
Context menu in GitKraken Desktop showing the option 'Create branch here' when right-clicking a commit labeled HEAD
Start a branch from your current detached commit to keep your changes.

How to exit detached HEAD state

To exit detached HEAD state:

  • Check out any local branch.

This will remove the HEAD label and discard any unpreserved commits.

Animation showing how unbranched commits in GitKraken Desktop are removed from view after switching branches from a detached HEAD state
Unbranched commits are removed when you check out another branch.

Important: Commits made in detached HEAD state will be lost unless you create a branch. You may be able to recover them manually.


How to recover lost commits

If you accidentally switch branches before saving your changes:

Have feedback about this article? Did we miss something? Let us know!
On this page