July 2018
Beginner
552 pages
13h 18m
English
Reverting, in terms of Git, means rolling back the changes from one or more commits. This is one of the reasons why your commits should not contain changes to loads of files. Reverting such a change will disrupt more than it fixes. With reverting, a new commit is created that reverts all changes performed in that specific commit:
# Changes to a file that need to be rolled backAdd-Content -Path .\NewScript.ps1 -Value 'Get-Process -Id $pid'git add .git commit -m 'Added get-process to script'Add-Content -Path .\NewScript.ps1 -Value 'Restart-Computer -Force'git add .git commit -m 'Added restart-computer to script'# Revert first change as a new commitgit log# Revert all changes within this commitgit revert 02fdabc# Verify that your change ...
Read now
Unlock full access