Helix Core — version control from Perforce — tracks, manages, and secures changes to all your digital assets, including large binary files. Scale your infrastructure, support your remote teams, and move faster.
Full Video Transcript
Hi everyone, this is Ryan at Perforce and today we're gonna talk about undoing changes that have been already committed to the server. Now this is a situation that will likely happen at some point during your working time, whether it's changes that you've made that you've pushed, that's whether client decides they they don't prefer that and they'd like to roll back or if a bug was introduced or anything like that. And instead of moving forward and correcting that at that time, that it's more advantageous to just roll back to an earlier version. So we're gonna show you how to do that and handle that when interacting with your Perforce server.
So for this example, I've got this little file here - this undo change example - and that's five versions, And just to for the basis, it's a very simple file for this example.
I just have five edits, and each one of these lines is added in an individual change list. That way we can show, when things are removed. So you can see that right now my local workspace is up to date. I have version five of five versions that are on the depot. But if I wanted to roll back and undo some of those changes, there are a few options I have available.
So if I right-click and in my context menu go to undo changes, for this single file.
That'll open up a dialogue here that will give us three options. We can either decide on a specific revision that we would like to remove and remove those changes that were introduced there, we could also choose from a range of, are revisions or change lists and remove an entire range, or we can select a specific change list and revert to the point just prior to that. So we'll go through an example of all three of these.
And while this example is done on a individual file, you can run this command on a folder as well. Everything that we do here for a single file, will also operate in that folder style where it will identify all affected files and prompt you with resolution prompts when it comes time.
So for this first example, let's just go ahead and undo a single change.
Now for this file, I can either choose from a change list or revision if I happen to know the change list number, but let's go ahead and say we want to remove revision three out of five here. If I wanted to, I could preview this edit. This preview works better on an a folder selection because there may be many files that are being affected added deleted, edited, things of that nature, and this will give you kind of a view of all of that.
Currently, as I have a single file, loaded, it's really only going to tell me that there was a single revision that's gonna be edited here.
But if I were to go ahead and save this to, say my default change list, we can then step over to our pending change lists and see that we've got our revision here. And you'll also see that our little icon has changed in our workspace.
What this means is that we've rolled back to revision three and that also we have a pending integration to go over and resolve.
So once we're in this state where we've gone back to revision three, and we've actually it has removed that line or those edits from revision three. So it We're on revision three, but we're actually looking at the content from revision two because it's gotten rid of those edits.
From here, we would go ahead and get latest.
And when we do this get latest, it will try to pull our latest revision, notice that there are still differences that need to be resolved, and put us in this conflict resolution state. So that's what this question mark means. There's currently a conflict the system needs to know what to do, and it would like you to resolve it.
So at that point, we can right click and go to resolve, and which will open up our resolve dialogue.
From here, you can either Grab the common base, which is this version three, select your source file, or select your target file, which if we were to expand these out a bit.
You can see that our resolve source here is versions four and five.
While our target is actually just our local workspace versions, which is based off of revision two since we were removing revision three.
To show what's going on, I'm gonna go ahead and hit the merge tool here. And this will show what the plan is if we were to accept merged, where we end up with our two lines that already exist, are two lines that come from revisions four and five, and that revision three here will be deleted.
And so for me, that's totally fine. That's what I'm expecting to see. So I'll go ahead and hit save. It'll ask me if I would like to replace my file with those merge results, I can say yes. And now we are no longer in a conflict state. We are technically on revision five zero five with edits to our file.
And if I pull that file back up here, you can see that Line three no longer says, third line addition. It says fourth line because that came from our fourth revision and our fifth revision. So that single change list has now been removed.
At this point, I could go ahead and submit these changes back and that new reverted version that has Change list or revision number three removed from its own history will be then be committed back as revision six so you can go forward.
Nothing is ever really lost when you're using Helid score or any sort of version control in that style. So revision three still does exist as well as four and five. And this six will now become that new edited state where three has been removed.
I'm going to go ahead and revert this for this moment so we can show you the other options. But I just wanted to kind of point out that you always will be submitting back that new revision.
We'll say revert.
And let's go ahead and try out our other options here.
So if I were to jump back in here and say undo changes one more time, And let's do an unarranged this time, and we'll go ahead and say, anything from revision two to four.
Similarly, we can go ahead and save this to change list.
Again, we can resolve, get latest revision, and then resolve our conflict state.
If I were to again run this merge tool, we'll see that in this time, the second, third, and fourth revisions or the the content that was added by those revisions are being removed and were left with that. The content added on revision one, and the content added on revision five with everything in between scrubbed out.
So if I save that, close, and I'll tell it go ahead and replace. If I click back over here, We've got our first and our fifth revision content represented now in our local workspace.
And so now, again, this is still local workspace. I can now submit this for revision six, which would then update it for The server, which would then also notify anyone else that has a workspace with this file in it, to pull down the latest revision to get the latest content.
So let's go ahead and revert this one more time.
And then our last option in here, we go ahead and do an undo change one more time. Is to undo all changes from a certain selected point to the most recent revision.
With that, if I were to say Revision two here, and say, let's save this to the default again, and I'll go ahead and save this to change list.
What you'll see is that revision two, as well as three, four, and five will all be excluded from this file. And to notice I'm not entered into a conflict state at this point, because what it's really doing is going to the reversion right before you've what you've selected, and putting that back in place and doing that get latest for you. So it just kinda pulls the content directly out of that revision, into your local workspace file. So if I were to come over here, I only have revision one's content in place.
And so, again, now I'm ready to go ahead and submit this change back to the server, making revision six match the content from revision one. And we still have all that other history. If we needed to go back and troubleshoot and figure out what actually had occurred or broken, we can still see that. We haven't actually fully lost anything.
And we're not in a bad state.
So let me revert that one more time.
There's one more thing I do want to show you guys here, which is if we were to select ace folder hierarchy, we do still have that option to undo changes.
And in here, If we wanted to undo a single change, we would want to select a change list, or a range of changes.
This is the difference here is that you can actually select your time frame, and if you're doing a folder or things of that nature. So here, because or not mapped to specific provisions and all of that. If I wanted to undo everything from Today, we'll say, two days ago, we'll just try and skip over all of that. Here's what we can also preview. And see all of our changes that would occur. Here are the file changes that would be undone. So revision two of these files would be undone.
As well as these files would be deleted and removed from our workspace because they didn't exist at the time, or their introduction and and subsequent edits occurred during that time period.
So we can preview that. We can also save that to a change list.
And once we go ahead and save that, this is just a warning that's popping up that saying, hey, I've marked some things for delete because they did not exist. So if I wanted to revert back to the state that this workspace looked like at that point, I need to actually mark these for delete.
And so we have all of our files here with that sort of those edits in place.
And, again, Now if there are any resolutions that need to take place, you would be able to get latest, resolve those, and then submit back, or if there's nothing that needs to be resolved in that style. You can actually just submit these changes back to restore an entire folder structure to a previous state, and that was found at that time.
So I hope this has been helpful, and it's how you can go ahead and manage undoing changes that have been recorded into your healer's core server easily and without fear. Thank you.