The branch was gone. You knew it was there yesterday. Now your hands hover over the keyboard, trying to remember the exact command that will bring it back — but this time, you’re not in Git. You’re in Mercurial.
Switching between Git and Mercurial feels simple until you hit that muscle memory wall. You type git checkout and nothing happens the way you expect. In Mercurial, the equivalent is hg update. The verbs are different, but the concept is the same: you want your working copy to match a specific commit, branch, or tag.
In Git, checkout is a multitool. You use it to move between branches, restore files, or inspect a past commit. In Mercurial, the world is split into smaller commands. hg update changes your files to match a changeset. hg revert restores files. Each is sharper and narrower in focus, and this distinction matters when you work across both systems.
Using Mercurial to check out a branch is straightforward:
hg update branch-name
To jump to a specific commit: