With Abstract’s version control, you can revert a project’s main branch or your other branches to any previous commit. Restoring a previous commit returns the selected branch to exactly how it looked at that point in time. You can also restore individual files to previous versions of the file without affecting all of the other files in your branch.
To prevent data loss and accidental overwrites, you cannot restore to a commit that came before an update from parent or update from the main branch.
Restore a branch to a previous commit
Any Contributor can restore the main branch to a previous commit. You can only restore branches you own.
To restore the main branch or another branch to a previous commit:
- Open the Abstract desktop app.
- Select the project you’d like to restore.
- Select Main (to restore the main branch) or a branch (to restore your branch) from the left side pane.
- Click the Commits tab at the top.
- Select the commit you’d like to restore to.
- Click the icon in the top right.
- In the Restore Commit modal, summarize why you’re restoring to this commit.
- Click Restore commit.
This restore is recorded in the branch history of the branch you selected.
If you change your mind about restoring to a previous commit, simply follow the instructions above to restore to a different commit. Each commit is a snapshot of the complete project. You don’t lose any commit history by restoring.
Restore a specific file to a previous commit
Sometimes you may want to restore a single file to a previous version while keeping all of the other files in your branch (main or otherwise) up to date. You can do this on any individual file in a commit by clicking the restore file button instead of restore commit.
Restoring a file only returns that one file on your branch (main or otherwise) to exactly how it looked at that point in time. All of the other files remain as they are.
To restore a file to a previous commit:
- Open the Abstract desktop app.
- Select the project with the file you’d like to restore.
- Select Main (to restore a file in the main branch) or a branch (to restore a file in your branch) from the left side pane.
- Click the COMMITS tab at the top.
- Select the commit that has the version of the file that you’d like to restore.
- Click the icon on the right side of the file name. (Look for the tooltip to make sure it says Restore file, not Restore commit.)
- In the Restore File modal, summarize why you’re restoring this file.
- Click Restore File.
Restore work from before an update
In order to prevent data loss and accidental overwrites, you cannot restore before a branch update. However, you may find that there are times when you need to restore work from one of these previous commits. To restore this type of older work, you three options:
- Create a new branch from a previous commit
- Export an older version of the file and replace the newer version (good for large amounts of older work)
- Open a file untracked to copy changes to a new commit (good for small amounts of older work)
Restore work by creating a new branch from a previous commit
To restore work by creating a new branch:
- Open the Abstract desktop app.
- Select the project with the work you want to restore.
- Select Main (to restore a file in the main branch) or a branch (to restore a file in your branch) from the left side pane.
- Click the Commits tab at the top.
- Right click the commit that has the work that you want to restore and select Create Branch...
- Give your new branch a name and select Create branch.
With this method, your new branch is added as a child branch below your current working branch. You can switch to this branch and continue working from the files as they were at that point in time, then merge the child branch back into the parent branch when you’re finished.
Read our merging best practices to learn more about resolving any merge conflicts that might come up at this time.
Restore work by replacing the newer version
If you have a large amount of older work you want to restore, it's easiest to export the older work and replace the new version with it.
To restore work by replacing the newer version:
- Open the Abstract desktop app.
- Select the project with the work you’d like to restore.
- Select Main (to restore a file in the main branch) or a branch (to restore a file in your branch) from the left side pane.
- Click the Commits tab at the top.
- Select the commit that has the work that you’d like to restore.
- Click the … menu next to the file name and select Export…
- Save the file to your desktop.
- Click the Files tab at the top of the page to navigate to the current version of the branch you want to restore the commit to.
- Right click the matching file and select Replace…
- Select the file you saved to your desktop and choose Import.
Restore work by copying changes to a new commit
If you have a small amount of older work you want to restore, it's easiest to open the changes untracked and copy them to a new commit.
To restore work by copying changes to a new commit:
- Open the Abstract desktop app.
- Select the project with the work you’d like to restore.
- Select the branch from the left side pane.
- Click the Commits tab at the top.
- Select the commit that has the work that you’d like to restore.
- Click Open Untracked next to the file that you want to restore.
- Copy the work you want to restore.
- Click the Files tab at the top of the page to navigate to your current work.
- Click Open in Sketch to open the current version of the file that you want to restore.
- Paste the copied layers from the untracked file into the correct artboards in the current file.
- Click File > Save or ⌘+S to save your changes.
- Click Commit Changes to complete the restore.
Deleting artboards can cause collections to have missing screens. For the best results using this method, copy only the changes on the layers you want to keep and paste them onto existing artboards in your current file.