History and Reverting

History and Reverting Changes

One of the biggest benefits to Git is that it provides a meaningful history of changes to your files. This history allows you to also quickly revert changes, enabling better production uptime. This section will teach you how to see your version history, as well as how to revert simple changes.
In most cases, you cannot revert if your IDE is open

View History (desktop)

Click the History tab in the top left corner the Copia Desktop app.
You should see changes from each revision rendered in a panel to the right.

View History (web)

A repository's history is also viewable on the Copia web app. Click on the Commits button.
This page can be found at{your-username}/{your-repository} where {your-username} is the name you created at sign-up and {your-repository} is the name you created in the form above.

Retrieve Previous Revision (web)

Once you're viewing a commit history, you can retrieve a previous version of a file.
Click the commit that you care about. This will show you the changes in that commit.
Click View File.
Click Download to download the file.

Retrieve Previous Revision (desktop)

When viewing the history in the desktop app, and you would like to access the files of a previous commit, you can use the "Checkout Commit" option. This feature can be found on the right-click menu of a commit.
By selecting this option, you are "temporarily" reverting to an older commit. As such, your repository files and commit history will be temporarily reverted to the prior state. This state in Git is called a "Detached HEAD" and is treated like an temporary local branch (see below).
At this point, you can access your local repository and it will reflect the files at that commit point. As such, this can be used to revert files to a prior state (or just for review) by either:
  1. 1.
    Making a copy of those files to later commit
    • After copying the files to another location, you can cancel the Checkout by just switching back to the Main branch from the dropdown.
  2. 2.
    Creating a new Branch from the Detached Head and merging
    • In the Branch dropdown, select "New Branch" which will use the Detached HEAD as the revision for the new branch
To just cancel the entire Checkout operation, just switch back to the Main branch from the Branch dropdown.

Revert Change (desktop)

In the case of having introduced a regression, you might want to "revert" a change, which is to say, remove that change from the top of the main branch.
Reverting a commit is straightforward in the Desktop App. After clicking on the History tab and right-clicking the commit you want to revert, choose Revert Changes in Commit.
Push the revert.
This last step might seem strange, but it's actually a safety feature of Git. Instead of simply "deleting" the old commit, it instead appends a new change which represents the removal of the old change. This means that no file or no change is ever "lost."
It's part of why Git is so amazing. It's not uncommon to see "Revert "Revert commit..."" when people realize they actually wanted the change they reverted.

Merge Conflicts

Because reverting a change actually represents the introduction of a new change, it can sometimes cause merge conflicts. This is an advanced use case handled under merging.