From the course: Visual Studio: Source Control with Git and GitHub
Unlock the full course today
Join today to access over 22,500 courses taught by industry experts or purchase this course individually.
When to use revert or reset - Visual Studio Tutorial
From the course: Visual Studio: Source Control with Git and GitHub
When to use revert or reset
- [Instructor] We have a problem in this repository. Terry has checked in some code into the shared repo and she's made a mistake. So we would like to roll back. And when you want to roll back changes, there are other options besides the Visual Studio undo action that I showed you earlier. To get to these actions in Visual Studio, go to History, and then right click on one of the commits. There's two choices, Revert, and Reset with two options, Reset, Keep Changes and Reset, Delete Changes. Now, what's the difference between the two? You use revert to undo the changes made in your commits that have been pushed to the shared branches. Now, that's the problem that we have. Terry has pushed this to the remote repo. So what the revert command does is it creates a new commit that undoes the changes on the previous commit. No history is rewritten and revert making it safe to use when working with others. So let's…
Contents
-
-
-
-
-
-
-
-
Change the PowerShell command prompt1m 19s
-
Show the Git help files from the command prompt1m 24s
-
Commit to local: VS2m 52s
-
Push to remote: VS1m 16s
-
Commit and push: VS1m 16s
-
Undo changes3m 6s
-
Show history with Git log: PowerShell2m 19s
-
Show history in Team Explorer1m 53s
-
Compare differences: VS2m 21s
-
When to use revert or reset3m 3s
-
Rollback to prior commit with revert55s
-
Rollback a local repo with reset1m 46s
-
-
-
-
-
-