Discard Changes From the Workspace
Currently, when you edit a file and you do not want to keep it, you can revert the topic to the most recent version, but the topic remains on the Overview page. The only way to remove the topic from the Overview is to make a commit (i.e., the file is committed back into the repository).
If you want to discard changes in the workspace without having to commit the file, there is now a way to do that. With this release, authors can delete or clear pending edits.
[Menu Proxy — Headings — Online — Depth3 ]
Permission Required?
Editing content and project files is an activity available to users with the Author status. By default, users with Author status have the following permissions set:
-
If this is deselected, then viewing files in a read-only mode is allowed. On the left side of the page, the Files vertical three-dot menu is not available.
-
If this is deselected, the XHTML in the Code view is read-only.
Editing code is regarded as a capability for an advanced user. If not done properly, the code can become malformed quickly. Administrators can prevent users from editing the code by deselecting the Edit Code permission.
For more information about permissions, see Setting User Permissions or Setting Team Permissions.
Why Is Discarding Changes Significant?
Being able to discard changes is significant because you can remove pending edits from the workspace—to the point of restoring the file to its latest committed state—without having to commit the file.
You can navigate away from the topic and still discard changes. When editing, you could use the Undo button from the local toolbar to reverse the most recent action and step-back edits. But there are limitations to this function. If you move away from editing a topic by clicking another topic and then navigate back to the topic you were editing, the Undo button resets (i.e., it is disabled until new editing occurs). Instead, you can simply discard the changes.
You can quickly remove edits and start over. You could revert to a previous version, but you would still need to go through the process of committing a file to the repository. This might seem arduous if you just want a fresh start to editing a topic.
Workspace UI Updates
When you click a file in the workspace, to the right of the Commit button you will notice a vertical three-dot menu in the Content Editor’s local toolbar. For a file in a committed state, the menu displays with Rename, Delete, Show in File Tree, and View Raw options.
Once you start editing a file in the editor, the local toolbar menu additionally includes a Discard Changes option. The topic is in “Workspace” mode, the version history area updates, and the file is listed in the Overview page.
Note Discarding changes does not affect the timeline. In other words, when you discard changes, you are only removing edits up to the last commit. The integrity of the version history and the existing commits in the timeline are left alone.
Note If an author has pending edits in a topic and decides to revert, the revert function requires a commit or a discard of changes to be done.
How to Discard Changes
What if I made changes while editing, but I do not want to commit them or add them to the version history? Fortunately, there is a fail-safe option to discard unwanted changes.
-
Do one of the following:
-
From the Content Editor’s local toolbar, click the vertical three-dot menu, and select Discard Changes.
-
From the Files tree, right-click the file, and click Discard Changes.
-
From the file row on the Overview page, click the vertical three-dot menu and select Discard Changes.
-
From the Overview page, select a file and click
.
-
-
In the Discard Changes dialog, you are alerted to affected file(s). Click the Discard Changes button (or click Cancel to back out of the operation). If multiple users are editing the same file, the Discard Changes dialog warns you that others are editing and that discarding changes will remove their changes as well.
When done, all pending edits since the last commit are removed from the editor, the Files tree status indicator is cleared, and the file is removed from the Overview page. This means there is no version history for the discarded edits.
Note If you click the Discard Changes option, any added file(s) will be permanently deleted, and modified file(s) will permanently lose uncommitted changes.
Note Discarding changes can affect other users. Because collaborative authoring is always happening, authors discarding changes are doing so not only for their changes, but also for any other author's changes for the same file. For this reason, it's important to stay in communication with other authors to make sure you are not deleting edits that they may wish to keep. However, the editing process includes safeguards and visible cues in the interface to commit files without issues.




