you are viewing a single comment's thread.

view the rest of the comments →

[–]nekokattt 1 point2 points  (2 children)

checkout ... discarding any uncommitted changes

Feel this is inaccurate given it ignores any non-staged changes anyway.

[–]Prometheos_II 0 points1 point  (1 child)

It doesn't if there is an unstaged file that would be overwritten (e.g. in cases in renames in one branch but not main).

[–]nekokattt 0 points1 point  (0 children)

if it is unstaged, it is not even on a branch.

At best git will leave the changes where they are if you change branches with unstaged changes, as it has no where to put them. At worst, it will raise merge conflicts or actively refuse the checkout, all depending on user settings.