(created/git2cpp/checkout.md)=
# git2cpp checkout

```{parsed-literal}
Switch branches or restore working tree files


git2cpp checkout [OPTIONS] [&lt;branch&gt;]


POSITIONALS:
&nbsp; &lt;branch&gt; TEXT               Branch to checkout

OPTIONS:
&nbsp; -h,     --help              Print this help message and exit
&nbsp; -b                          Create a new branch before checking it out
&nbsp; -B                          Create a new branch or reset it if it exists before checking it
&nbsp;                             out
&nbsp; -f,     --force             When switching branches, proceed even if the index or the working
&nbsp;                             tree differs from HEAD, and even if there are untracked files in
&nbsp;                             the way
```
