Version Control and GB Studio: Reverting Changes

Last time, I showed you how to get started with Version Control. We made a repository, uploaded a project, and updated the files.

In this second part, I’ll show you how to download an older version of the project, and then how to reset your Github repository to that older version. What good is a backup if we can’t access it later, right?

GB Studio is unique in that all your scripts, dialog text, and actor setups are all stored in a single .gbsproj file. As long as you keep all the assets in-tact, you can upload your project’s contents into Github just like before. We’ll be using this to overwrite our current files with an old backup. Follow these steps:

1. Go to your repository page

2. Click the words “x commits”

3. Scroll down to find the snapshot you want to restore

Now, there are several ways to reset what you’ve worked on. If you’re just using the website

4. Click the “< >” icon

Note: You should now be looking at an old commit, you can confirm this by looking at the “branch”. I’ve highlighted this in yellow, it’s a “hash” of numbers and letters.

5. Click the green “Code” button

6. Click Download ZIP

7. Unzip the contents to a new folder in your computer

You have now successfully recovered a backup.

If this is your first time recovering a backup from Github, I recommend you use GB Studio to open up both the old version you just downloaded and your current version. Check the scripts, assets, dialog, scenes, and palettes. Double check to ensure you downloaded the correct version.

Once you’ve confirmed that you want to keep working with old files, you can upload those old files as if they’re recent updates. This will overwrite your current Github files with the old backup you just downloaded. This is a nice solution because nothing gets removed, you can always return to the commit just before you uploaded old files to the project. This makes for a weird Git history, but with GB Studio there’s no danger of conflicting files or losing any data.

Now, if you don’t like seeing old files get uploaded to your repository, and you just want to undo a commit you made, it’s not possible on the website. Using downloaded tools, you can revert to a commit and force push your reverted version to Github. This can be done using Github Desktop, other Git GUIs, and Git command-line tools like Git Bash. Using these programs is also super useful if you have many files to upload at once.

Now you should have your old project back. You may end up with some assets you’ve previously deleted, and that’s a quirk of using the Github website instead of a version control client.

In Part 3, we’ll look at using Github Desktop, one of many clients for managing our project on a service like Github.