# stuck and need unstuck (git checkout)

2 messages from 2013-03-25 to 2013-03-30. Participants: J.V., Phil Hord.
Thread: https://gitlist.dev/t/33280

## J.V., 2013-03-25 17:57

Subject: stuck and need unstuck (git checkout)
Message-ID: <51508FFA.4080404@gmail.com>
URL: https://gitlist.dev/e/51508FFA.4080404%40gmail.com

```
I was on a branch (local tracked with remote), and I wanted to checkout 
a remote branch so did:
     $git co myRemoteBranch

and got a message that a lot of jar files were being untracked (files 
were locked).  I had a server running that had some of the jar files 
locked, so it could not update and untracked them all.

What I want to do now is:
     1. switch branches
     2. delete this locally created branch
     3.  re-check out again so all will be well.

I cannot switch branches because it says my untracked files will be 
overwritten.  How do I switch branches? I have no commits to make and 
simply want to go back.  git reset and git stash do not get me there.

thanks

J.V.

```

## Phil Hord, 2013-03-30 20:48

Subject: Re: stuck and need unstuck (git checkout)
Message-ID: <CABURp0ra4znHXVmUjMK2kOjPLHe2Dys46HZ=wC=LWri_sFag0Q@mail.gmail.com>
URL: https://gitlist.dev/e/CABURp0ra4znHXVmUjMK2kOjPLHe2Dys46HZ%3DwC%3DLWri_sFag0Q%40mail.gmail.com
In-Reply-To: <51508FFA.4080404@gmail.com>

```
On Mon, Mar 25, 2013 at 1:57 PM, J.V. <jvsrvcs@gmail.com> wrote:
> I was on a branch (local tracked with remote), and I wanted to checkout a
> remote branch so did:
>     $git co myRemoteBranch
>
> and got a message that a lot of jar files were being untracked (files were
> locked).  I had a server running that had some of the jar files locked, so
> it could not update and untracked them all.
>
> What I want to do now is:
>     1. switch branches
>     2. delete this locally created branch
>     3.  re-check out again so all will be well.
>
> I cannot switch branches because it says my untracked files will be
> overwritten.  How do I switch branches? I have no commits to make and simply
> want to go back.  git reset and git stash do not get me there.

Does 'git checkout --force yourLocalBranch' help?

Phil

```
