Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Empty classes after creating a new branch

Hi, I've had an issue with Sourcetree and IntelliJ.

I was working on a project on master branch.

I've made some work and created a new branch, and commited on that new branch.

When I switched to master, I had my project as I expected it to be.

But when I switched back to my new branch, all the classes and files I created were there, but in the same state they were created.

Classes are empty now, for exemple,

package ...
public class MyClass extends OtherClass{
//my code


public class MyClass{

And this, for all the new classes and files I created between my last commit and the creation of my new branch.


How can I retrieve my work please ?

1 answer

0 votes
minnsey Atlassian Team Feb 18, 2019


I don't know how Intellij acts by default but is it possible the files weren't saved in their edited state before Sourcetree was used to commit them?

Other than that I can only suggest looking through the Git log to see if they files appear in a commit in the state you expect.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Sourcetree

Tip from the team: configure your repos for hosting goodness!

Supported Platforms macOS Windows We recently introduced support for additional hosting services such as GitHub Enterprise, GitLab (Cloud, Community Edition, Enterprise Edition), and...

7,098 views 5 13
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you