Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Project has reset to older version



  • Last night I found that changes I made to the gui did not get compiled when running the code.
    I did a "clean".
    I also updated QT.
    After that the project was no longer available in QT, so I opened the pro manual from within QT.
    Only to discover that i'm now working in a very early version. Basicly the last 2 weeks of coding vaporised.
    I have not set anything special for versioning or anything.
    Nor have I changed any QT setting since I started the project.

    How do I recover the code of the past 2 weeks? Where did it go?
    How do I prevent bad jokes like this from happening?


  • Lifetime Qt Champion

    @Komerad said in Project has reset to older version:

    How do I recover the code of the past 2 weeks? Where did it go?
    How do I prevent bad jokes like this from happening?

    Hard to say. There is no need to update Qt in such a situation.
    What exactly do you mean by "clean"?
    "After that the project was no longer available in QT" - I guess you mean in QtCreator (is not the same as Qt)?
    How do you manage your code? Do you have any backups or anything?
    As you can see it is very important to have regular backups and even better to use a code version system like Git. Coding 2 weeks without any backups is a fault of the developer.



  • @Komerad
    If you don't know where your code of two weeks has gone, we do not know either. We/Qt cannot recover old code for you. You can recover your code either from your backups or from your git/github-type system.

    Doing a project "clean" or installing a new version of Qt does not destroy your own files. At least, provided you are not doing something like your own code inside Qt system directories. You might do a thorough search of your disk for a known filename among those missing to see if you can find it anywhere.

    To prevent this from happening, apart from enforcing good backup practices, you would need to discover what actually happened for you to lose your source files so that you can ensure it does not happen again.



  • It is in QT creator indeed.
    I understand the need of backups but that does not change the fact that I still wonder why it rolled back like +-2 weeks.
    I do have the files where they should be it's just like it has "undo" everything from the past weeks.
    The only thing I can do is start over, take backup everyday and be just as surpised next time it happens.


  • Lifetime Qt Champion

    @Komerad Hard to say what exactly happened without knowing more about your system. I doubt QtCreator is the reason. Where do you store your project? Folder, file system, ...



  • @Komerad
    OK, but let's just think about it logically. How could Qt Creator roll back two weeks work? It's not magic. It would have to have a copy of how the files were two weeks ago, which it just does not keep. The only thing which would allow that is if you are using Git or similar inside it for your project --- are you?

    Do have one more careful look around, just in case you have some second copy of older/newer files in another directory somewhere.

    P.S.
    No offence, but indeed you should be keeping a backup of everything you do every day. Either explicitly as a backup, or via Git or similar.



  • No offence taken, its a hobby project, quiet some hours but not a 80 hour loss.

    "How could Qt Creator roll back two weeks work? It's not magic. It would have to have a copy of how the files were two weeks ago, which it just does not keep."

    That is what confuses me.

    Tought to ask here as there might be a known reason and sollution as to why a project has a roll back.
    I search the pc for another project copy tonight but have not changed paths or anything so I don't expect to find it anywhere else.



  • @Komerad
    Since it's a hobby project, may I suggest you look at https://github.com/. This would allow you for free to maintain all the versions of your code you choose to deposit up on the ethercloud. Apart from giving you "free backup" of every version of your work, it also allows you to do things like compare new versions against old versions when you're trying to figure consequences of changes in your code.

    It's all integrated from within Qt Creator via Git/GitHub. If you are, say, Windows a little tutorial is https://cpb-us-w2.wpmucdn.com/u.osu.edu/dist/7/11881/files/2018/02/QtCreatorGitTutorial-2ahr2m0.pdf, or there are plenty of others around. It takes a few minutes to set up, but once you have done so you will want to use this always. At least then if for whatever reason you "lose" stuff again, like you're worried about and don't know why, you won't actually lose any work.


Log in to reply