I did a pull while I had local changes I'd made in Sublime that were not committed. How do I get these back?

KAZ Vorpal November 3, 2014

Using SourceTree and Git, I did a pull while I had local changes I'd made in Sublime that were not committed. I thought that the changes would merge down into my local version, but mine appears to have been wiped out.

How do I get it back?


1 answer

0 votes
Balázs Szakmáry
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 3, 2014

The changes you pulled got auto-merged into the files in your working copy. Your changes and the pulled changes should both be there in the files. (If there is any kind of conflict, pull fails and tells you to commit first.)

(All this above is only true if you are using an up-to-date version of Git. If not and your changes are gone, they are gone and there is no way of getting them back.)

KAZ Vorpal November 4, 2014

Could this be a factor: The file was new to the repository. Essentially, I took layout.css and made a new file called layout.less, because we're adopting LESS for managing their styles. I also emailed the layout.less to the client. He added it to the Git repository. I continued making changes on my local version. Then, when I did the update, it did NOT warn me the way I expected, it simply wiped out my local, newer version. Could this be because my local version was a non-entity, as far as Sourcetree/Git was concerned? In other words, I had never directly added it to Git, but I had it in that directory. The client added it to Git in the same directory. When I did the pull, as far as Git was concerned my local machine didn't HAVE a copy, officially. So it overwrote mine?

Balázs Szakmáry
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 4, 2014

Yes, probably something like this happened. Anyway, next time, either stash or commit all your changes before pulling/merging... You might want to take a look at your recycle bin, perhaps it has the deleted file.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events