Recent Changes - Search:

Basics

Languages

Tools

OS

Resources

PmWiki

pmwiki.org

edit SideBar

Git /

Show

While one generally "goes back in time" using Checkout to see the whole working directory as it was, it is possible to recover the old version of a given file using:

git show HASH:Path/To/File > OldVersion

where HASH is the commit hash identifying which older version to look at, Path/To/File is the path to the file to be viewed and OldVersion is the name to be given to the file.

WARNING: If OldVersion is not supplied, it will keep the same name and overwrite the newer version. While the last committed version can always be recovered, any non-committed changes will be lost. It is much safer to always rename it to something else.

Edit - History - Print - Recent Changes - Search
Page last modified on May 08, 2017, at 07:28 PM