[TIL] git: moving unstaged changes to a new branch

TIL that in git, it's possible to directly move unstaged changes and switch to a new branch, using command git switch -c new-branch.

Very useful when one forgets to create a new branch and starts to do some work on the mainline branch.

Found on this CSS-Tricks article.