# Defold and Github killed my game

**URL:** <https://forum.defold.com/t/defold-and-github-killed-my-game/79094>\
**Category:** Bugs\
**Created:** [December 8, 2024, 9:00pm UTC](https://forum.defold.com/t/defold-and-github-killed-my-game/79094 "2024-12-08T21:00:41Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jay\_Cee](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/jay_cee/32/34527_2.png) [@Jay\_Cee](https://forum.defold.com/u/Jay_Cee)\
**Post date:** [December 8, 2024, 9:00pm UTC](https://forum.defold.com/t/defold-and-github-killed-my-game/79094/1 "2024-12-08T21:00:41Z")

</div>

I tried backing up my project on gitHub and defold crashed and “reverted”.  
All was fine. I just tried again, and it did a pull from Github and took my project back 5 months.  
I lost sooo much source code, image files and edits. I feel like just giving up…

I am using 1.9.5, as I updated from 1.9.1. That is how far back it went. Not sure if this is a bug or not.

---

<div class="post-metadata">

**Author:** ![GooseSwanson](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/gooseswanson/32/5844_2.png) [@GooseSwanson](https://forum.defold.com/u/GooseSwanson)\
**Post date:** [December 8, 2024, 9:55pm UTC](https://forum.defold.com/t/defold-and-github-killed-my-game/79094/2 "2024-12-08T21:55:33Z")

</div>

I’m terribly sorry. That’s a real gut punch. Did you make commits during those five months? If so, it’s most likely possible to recover the lost commits. Commits that do not belong to any branch in Git (meaning, you can’t see them) will still exist in the repository for some time. You can list these with `git reflog`, and from there recover them by creating a new branch that points to one of them. See this StackOverflow answer: [https://stackoverflow.com/a/34751908/8034688](https://stackoverflow.com/a/34751908/8034688)

Edit: here’s a more detailed explanation of references in Git and how reflog works: [Recovering lost commits with git reflog - Thomas Belin](https://blog.atomrc.dev/p/git-reflog/)

I hope it will help you recover your files.

---

<div class="post-metadata">

**Author:** ![goeshard](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/goeshard/32/38200_2.png) [@goeshard](https://forum.defold.com/u/goeshard)\
**Post date:** [December 8, 2024, 9:59pm UTC](https://forum.defold.com/t/defold-and-github-killed-my-game/79094/3 "2024-12-08T21:59:15Z")

</div>

Part of getting the most out of github is frequently identifying when your code is at a good restore point and committing it. It takes a while to develop good commit habits. Part of what leads to it is having disasters that set you back. Pretty much everyone learns the hard way. Hopefully you have some commits saved that you don’t realize can be restored.

---

<div class="post-metadata">

**Author:** ![Jay\_Cee](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/jay_cee/32/34527_2.png) [@Jay\_Cee](https://forum.defold.com/u/Jay_Cee)\
**Post date:** [December 8, 2024, 10:06pm UTC](https://forum.defold.com/t/defold-and-github-killed-my-game/79094/4 "2024-12-08T22:06:20Z")

</div>

Gonna check and see. One commit was lost

---

<div class="post-metadata">

**Author:** ![Jay\_Cee](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/jay_cee/32/34527_2.png) [@Jay\_Cee](https://forum.defold.com/u/Jay_Cee)\
**Post date:** [December 8, 2024, 10:09pm UTC](https://forum.defold.com/t/defold-and-github-killed-my-game/79094/5 "2024-12-08T22:09:45Z")

</div>

Okay, I found a commit from 12/3/2024. Still missing some new stuff, but I suppose I can redo it.

---

<div class="post-metadata">

**Author:** ![GooseSwanson](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/gooseswanson/32/5844_2.png) [@GooseSwanson](https://forum.defold.com/u/GooseSwanson)\
**Post date:** [December 8, 2024, 10:39pm UTC](https://forum.defold.com/t/defold-and-github-killed-my-game/79094/6 "2024-12-08T22:39:11Z")

</div>

Great to hear. Hopefully it won’t take too long to redo the last day’s work.

---

<div class="post-metadata">

**Author:** ![Jay\_Cee](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/jay_cee/32/34527_2.png) [@Jay\_Cee](https://forum.defold.com/u/Jay_Cee)\
**Post date:** [December 8, 2024, 11:08pm UTC](https://forum.defold.com/t/defold-and-github-killed-my-game/79094/7 "2024-12-08T23:08:39Z")

</div>

Ugh!  
The files I lost after clicking ‘pull’ were omitted from Defold’s changed files list. All those files, new files, were deleted. Why would any software delete files from my folder without asking? DANG IT!

---

<div class="post-metadata">

**Author:** ![mats.gisselson](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/mats.gisselson/32/3379_2.png) [@mats.gisselson](https://forum.defold.com/u/mats.gisselson)\
**Post date:** [December 9, 2024, 9:57am UTC](https://forum.defold.com/t/defold-and-github-killed-my-game/79094/8 "2024-12-09T09:57:45Z")

</div>

Terribly sorry to hear that. There might exist a git stash in your repository with the state of the working directory how it was before the sync with GitHub.

---

<div class="post-metadata">

**Author:** ![Jay\_Cee](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/jay_cee/32/34527_2.png) [@Jay\_Cee](https://forum.defold.com/u/Jay_Cee)\
**Post date:** [December 9, 2024, 2:49pm UTC](https://forum.defold.com/t/defold-and-github-killed-my-game/79094/9 "2024-12-09T14:49:32Z")

</div>

Thanks for the input. I did find one close enough, now I am just trying to remember all that I did after. I am getting there. Thanks.

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [December 9, 2024, 2:53pm UTC](https://forum.defold.com/t/defold-and-github-killed-my-game/79094/10 "2024-12-09T14:53:41Z")

</div>

> [@goeshard](#):
>
> Part of getting the most out of github is frequently identifying when your code is at a good restore point and committing it.

THIS! Don’t be afraid of creating feature branches with the stuff you are currently working on and commit often. Then squash the commits when you merge back to your main development branch to not clutter it with a bunch of dev commits.

---

<div class="post-metadata">

**Author:** ![Jay\_Cee](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/jay_cee/32/34527_2.png) [@Jay\_Cee](https://forum.defold.com/u/Jay_Cee)\
**Post date:** [December 9, 2024, 10:27pm UTC](https://forum.defold.com/t/defold-and-github-killed-my-game/79094/11 "2024-12-09T22:27:46Z")

</div>

I usually commit twice a week. But for some reason, Defold did not detect my changed files.

---

<div class="post-metadata">

**Author:** ![mchlkpng](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/mchlkpng/32/33984_2.png) [@mchlkpng](https://forum.defold.com/u/mchlkpng)\
**Post date:** [December 10, 2024, 7:44am UTC](https://forum.defold.com/t/defold-and-github-killed-my-game/79094/12 "2024-12-10T07:44:50Z")

</div>

This has happened to me twice. I only noticed when I was trying to bundle a project and realized that defold was referencing an older version of the script. I then closed defold just to see the file revert back.

I do have a question, had you closed the Defold app at all during this time? Or did you leave it running on your device? I have a hypothesis that leaving Defold running (therefore allowing it to use up more and more memory over time) causes this issue, but I have no proof for this.

This is a Defold issue by the way; GitHub can’t push be use Defold isn’t flushing the files so git can’t see changes

---

<div class="post-metadata">

**Author:** ![gianmichele](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/gianmichele/32/24028_2.png) [@gianmichele](https://forum.defold.com/u/gianmichele)\
**Post date:** [December 10, 2024, 10:32am UTC](https://forum.defold.com/t/defold-and-github-killed-my-game/79094/13 "2024-12-10T10:32:27Z")

</div>

It happened to me once as well. That time I had uncommitted changes when I did an editor update.  
Fortunately it was a minimal loss but I also could not reproduce it.

It goes without saying that I now commit before updating, and that’s in general good practice.

---

<div class="post-metadata">

**Author:** ![Jay\_Cee](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/jay_cee/32/34527_2.png) [@Jay\_Cee](https://forum.defold.com/u/Jay_Cee)\
**Post date:** [December 10, 2024, 4:33pm UTC](https://forum.defold.com/t/defold-and-github-killed-my-game/79094/14 "2024-12-10T16:33:17Z")

</div>

I do leave it running. Maybe a side effect.

---

<div class="post-metadata">

**Author:** ![goeshard](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/goeshard/32/38200_2.png) [@goeshard](https://forum.defold.com/u/goeshard)\
**Post date:** [December 10, 2024, 6:21pm UTC](https://forum.defold.com/t/defold-and-github-killed-my-game/79094/15 "2024-12-10T18:21:27Z")

</div>

I commit every time I do something and my brains goes, “okay it works.”  
Sometimes you even do it before the thing fully works, just before you’re about to start something that you don’t know if it will work.

At first it seems like you spend a lot of time logging everything you did but it eventually becomes second nature and saves you a lot of time when you need to be able to comb back through the history.

---

<div class="post-metadata">

**Author:** ![mchlkpng](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/mchlkpng/32/33984_2.png) [@mchlkpng](https://forum.defold.com/u/mchlkpng)\
**Post date:** [December 11, 2024, 2:10pm UTC](https://forum.defold.com/t/defold-and-github-killed-my-game/79094/16 "2024-12-11T14:10:40Z")

</div>

Also would be a good idea to periodically check that everything is actually being committed, as if the files aren’t on your computer git won’t get it. When I had his issue I assumed that Defold simply kept the fies in its memory for one reason or another. It’s weird cuz the 2 times it happened to me I was trying to bundle and it was stuck back at a specific time where there was an error in a script that no longer exists, but the compiler says there’s an error cuz it’s reading from the file that wasn’t updated

---

<div class="post-metadata">

**Author:** ![Mathias\_Westerdahl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/mathias_westerdahl/32/228_2.png) [@Mathias\_Westerdahl](https://forum.defold.com/u/Mathias_Westerdahl)\
**Post date:** [December 11, 2024, 4:22pm UTC](https://forum.defold.com/t/defold-and-github-killed-my-game/79094/17 "2024-12-11T16:22:07Z")

</div>

We’ll soon remove the push/pull functionality of this feature, and only keep the “changes” part.  
We’ve added tickets for this.

---

<div class="post-metadata">

**Author:** ![gianmichele](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/gianmichele/32/24028_2.png) [@gianmichele](https://forum.defold.com/u/gianmichele)\
**Post date:** [December 11, 2024, 4:57pm UTC](https://forum.defold.com/t/defold-and-github-killed-my-game/79094/18 "2024-12-11T16:57:51Z")

</div>

What’s the resoning for that? I find it quite convenient.

---

<div class="post-metadata">

**Author:** ![Mathias\_Westerdahl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/mathias_westerdahl/32/228_2.png) [@Mathias\_Westerdahl](https://forum.defold.com/u/Mathias_Westerdahl)\
**Post date:** [December 11, 2024, 5:24pm UTC](https://forum.defold.com/t/defold-and-github-killed-my-game/79094/19 "2024-12-11T17:24:05Z")

</div>

The reasoning is that it occasionally seems to trip up, and not work as the users expect.  
At the same time, there are much better tools out there, and we’d rather defer to their workflows.

E.g. we wouldn’t add an image editing tool in our editor, there’s Krita and Photoshop for that.  
Similarly, there are tools dedicated for source control.

---

<div class="post-metadata">

**Author:** ![gianmichele](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/gianmichele/32/24028_2.png) [@gianmichele](https://forum.defold.com/u/gianmichele)\
**Post date:** [December 11, 2024, 6:37pm UTC](https://forum.defold.com/t/defold-and-github-killed-my-game/79094/20 "2024-12-11T18:37:24Z")

</div>

That makes sense. What does the “keep the changes part” refer to? Just the list of changed files with the diff?

[Next page](https://forum.defold.com/t/defold-and-github-killed-my-game/79094.md?page=2)
