Have you ever accidentally deleted features or an entire tab, only to realize later that you still need them? This Tech Tip focuses on how you can selectively remove unwanted actions in the history of an Onshape Document.

The Versions and History panel tracks all the changes for an entire Document. In the example below, the Drawing tab was accidentally deleted:

Versions and history panel

Instead of recreating the Drawing from scratch, it is possible to restore it without losing other work in the Document.

In the Versions and History panel, click the dropdown under the workspace/branch to locate the action just before the Drawing was deleted. Right-click and select Create Version Here to create a version:

Create version here

Right-click on the version you just created and select Branch to Create Workspace to create a new branch from the version:

Branch to create workspace

Select Main to make it the active branch. Right-click on the newly created branch and select Merge into Current Workspace. Ensure only the Drawing is being replaced by the branch, then click the Merge button:

Merge strategy

Now, the Drawing is restored to the Main branch without any loss of work:

Drawing

In another example, the Fishing Reel has a solid spool that will not function correctly without holes for airflow:

fishing reel

There were holes in a previous version that need to be restored, but the Fishing Reel has changed since then, and it is important to keep that work:

Versions and history for fishing reel

You can restore the features with a method similar to the first example. Instead of creating a version just before the deletions, create one on the first action after the deletions:

Actions to remove

Make the branch workspace active. Right-click on the action before the features were removed and restore:

Restore to B1 version

Finally, make the Main branch active and merge the other branch into it. This time, in the Merge dialog, choose the option to Merge changes from both instead of Replace:

Overall merge strategy

Now, the Part Studio is restored without losing any work:

fishing reel restored

In this example, a delete action needed to be removed, but you could use this to remove any action (or series of chronological actions) from a Document. 

Extra Tip: You can delete the branch workspace once the restore is complete. If there are no versions on the branch, it completely removes the branch from Versions and History.

Watch the video below to see how this action works in real time. 

Interested in learning more Onshape Tech Tips? You can review the most recent technical blogs here

Onshape on YouTube

Subscribe to our channel to stay up-to-date on new product releases, Onshape Tech Tips, and more!