Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,554,093
Community Members
 
Community Events
184
Community Groups

PC crashed on commit and lost local workspace

Hello,

I'm a bit on panic mode at the moment. This is what happened: I just got a blue screen on my PC right when I was doing a commit into a local branch.

After restarting the PC I openend SourceTree and saw that I was checked out at the master branch instead of the branch in which I was working before the crash. What's more, the branch has disappeared completely and I have no local history at all.

The good news is that it looks like all the changes that I had made are still there. I see all the files in "Staged changes", but I need to stash them before I can switch to another branch (as I don't want to commit to master yet) and I'm getting the following error:

git -c diff.mnemonicprefix=false -c core.quotepath=false stash save AfterCrash

fatal: bad revision 'HEAD'

fatal: bad revision 'HEAD'

fatal: Needed a single revision

You do not have the initial commit yet

Completed with errors, see above.

Is there a way to recover the status of my workspace before the crash? What would be the best way to solve this issue?
I will really appreciate any help. Thank you!

4 answers

1 accepted

0 votes
Answer accepted

Well in the end I decided to start from scratch and clone the remote repo again.

Then I replaced the files by mine and now I can confirm that all the modifications are there. That was close :-D

@mention Do you have a system restore point for your local system and everything on it?  What is exactly wrong with your workspace and what exactly happened with your commit?  The system restore will have everything you had before, including the branch you couldn't fing and all of your history that was erased.  Try that.  It's easier than having to reset the whole thing. A lot of people had this prbloem with sourcetree.  But, see if it works.  I hope I was able to help.

I too get bluescreens on commits, Not always, but often. Stopped using the windows version and do it on the Mac version that seems to work fine.

0 votes
Pierre-Etienne Poirot
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Jun 24, 2014

You could solve that error by applying the following command:

git symbolic-ref HEAD refs/heads/name-of-the-branch-you-were-on

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events