Skip to content

Instantly share code, notes, and snippets.

@andreipak
Created March 22, 2017 08:07
Show Gist options
  • Save andreipak/e00566e60d185680e8b56bb53a9201f1 to your computer and use it in GitHub Desktop.
Save andreipak/e00566e60d185680e8b56bb53a9201f1 to your computer and use it in GitHub Desktop.

Revisions

  1. andreipak created this gist Mar 22, 2017.
    6 changes: 6 additions & 0 deletions git-time-restore.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    #!/bin/bash

    rev=HEAD
    for f in $(git ls-tree -r -t --full-name --name-only "$rev") ; do
    touch -d $(git log --pretty=format:%cI -1 "$rev" -- "$f") "$f";
    done