Check out and lost local files

There are many files that were in local. During initial development of some modules

many files were added  and lots of changes were done in a branch called cycle4


In the sourcetree develop branch is accidentally checked out

we lost all the new files and 6 days of change

Please help us resolve


1 answer

0 vote

Hi Kumanan! First of all, let me clarify that what you described does not look like a Sourcetree question, but like a Git question.

By default, Git should not overwrite local changes when you do a checkout. Did you use --force by any chance?

Did you added them before? If they were not added (which means git knows nothing about those files), then I'm afraid they're lost/
If you did git add previously, it will be possible to recover them but it will involve quite a lot of work. You can read more about it in the first answer of this post here.

Hope that helps!


Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

1,758 views 1 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you