Last updated: May 2025
Detached HEAD state lets you check out any commit in GitKraken Desktop without creating a branch. This is useful for reviewing or experimenting with past changes without affecting your active branches.
Enter Detached HEAD State
- Right-click the commit you want to inspect.
- Select Checkout this commit.

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

You can now review the full history and diffs, or create a branch from this state.
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.

To preserve your work, create a branch from the current commit:
- Right-click the commit tagged as HEAD.
- Select Create branch here.

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.

Important: Commits made in detached HEAD state will be lost unless you create a branch. You may be able to recover them manually.
Recover Lost Commits
If you accidentally switch branches before saving your changes:
- Click Undo in GitKraken if available.
- Use the CLI and run
git reflog
to find the lost commit SHA. - Then use
git checkout <SHA>
to re-enter that state.