>

Rollback a File Using Git

  1. Determine the version of the file (.git-include is used in this example) that is needed
    $ git lds .git-include
    76b7faf 2014-03-19 (HEAD, origin/master, origin/HEAD, master) added aliases lds ld and le to git-include file [Jay Everson (Macbook)]
    e729205 2014-03-19 Added cool aliases to .git-Include, found one the web [Jay Everson (Macbook)]
    56375a9 2014-02-01 Adding git include [Jay Everson (VM)]
  2. Checkout that version
    git checkout 56375a9 .git-include

Note: “lds” is an alias that is defined as:

lds = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short

It is just a pretty implementation of the log command.

If there is a need to undo the rollback use:

git checkout -- .git-include
banner ad

Comments are closed.