Difference between revisions of "Git Snippet: Revert"

From Coder Merlin
 
Line 12: Line 12:


== Revert to Commit ==
== Revert to Commit ==
<syntaxhighlight>
<syntaxhighlight lang="bash">
git checkout -f 2599172 -- .
git checkout -f 2599172 -- .
git commit -a
git commit -a
</syntaxhighlight>
</syntaxhighlight>

Latest revision as of 18:10, 18 February 2020

Within these castle walls be forged Mavens of Computer Science ...
— Merlin, The Coder

Revert to Tag[edit]

git checkout 1.1.1
git diff master > ~/diff.patch
git checkout master
cat ~/diff.patch | git apply
git commit -am 'Rolled back to version 1.1.1'
git push origin master

Reference: (Stack Overflow)

Revert to Commit[edit]

git checkout -f 2599172 -- .
git commit -a