Windows version bug that resulted in lost code

This is more of a bug report than anything, unless of course there is a way to retrieve my lost code.

I had about 30 files to commit. Some were existing files that I had changed, others were new files.

I switched Commit Mode to "Selected Files" then noticed that I had some PSD's that I did not desire to commit.

I did a search for PSD and narrowed the list down to two.

I right clicked the first PSD and selected REMOVE.

I right clicked the second PSD and selected REMOVE.

At this point, my list refreshed and I noticed that one of my files "DeviceManager.cs" was marked as having been deleted. Upon investigating further, it appears that Atlassian deleted the file in response to me removing one of the PSDs above.

I of course Discarded the delete, but as a result, my file along with all changes I had made were lost. Can I get them back? I'm guessing no... in any case, this is a pretty nasty bug that should be looked at. Hopefully what I listed out is enough to find and fix the thing.


This was using version

3 answers

1 votes
Colin Goudie Community Champion Apr 27, 2013
I don't use source tree but if you go to command line and do 'git reflog' it will show you the commit ids of every head you were at. In git, as long as its been committed at some stage nothing is ever lost. Even modifying commits is really just branching off an older commit. The original commit is still there. So I suppose for you if you have committed that file before then you can still get it back.

The problem is that I didn't have the changes committed yet, as they were newly made changes.

I'm very sorry about this, it sounds like a selection bug. I'll try to reproduce it - I assume that DeviceManager.cs was modified and the PSDs were untracked? Can you recall where they were in relation to one another in the list? It may not be specific to these issues but I want to make sure I nail it.

[edit]In answer to whether you can get the changes back, if they were uncommitted changes then I'm afraid not. You should have had a confirmation message about unrecoverable changes, but I expect that you assumed, understandably, that it was in relation to the PSD (it's the same message for untracked files). Again, sincere apologies for this.

So far I haven't been able to re-create this with - can you tell me what version you were using please?

Suggest an answer

Log in or Join to answer
Community showcase
Brian Ganninger
Published Jan 23, 2018 in Sourcetree

Tip from the team: workflow and keyboard shortcuts

Supported Platforms macOS Sourcetree has a lot to offer and, like many developer tools, finding and using it all can be a challenge, especially for a new user. Everyone might not love ...

238 views 0 3
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot