From the course: Working with LinkedIn Learning Exercise Files on GitHub

Roll back local branch changes - GitHub Tutorial

From the course: Working with LinkedIn Learning Exercise Files on GitHub

Roll back local branch changes

- As you follow along with the course, there will be times when you want to try some experiments and then roll back the experiments to get back to a certain point. You can roll back your changes using a restore feature that's available in Git. And that's available in GitHub Desktop with just a simple mouse gesture. In this example, I've once again added a line of code to an existing file. And I've done that in Visual Studio Code. And back in GitHub Desktop, I see the change reflected right here. If I want to get rid of that change and go back to the current state of the current branch, I just need to right click on the file and choose "Discard Changes". I can then click this button to confirm the operation. And when I go back to Visual Studio Code, I'll see that the code is back in the branch's starting state. So, that's called rolling back or restoring. And again, you can do that from the command line with Git, but GitHub Desktop makes it easy to do through this user interface.

Contents