Well let's see, you had a file in git, and one of the previous commits deleted this file.
You need this back.
Easiest way is to issue this command to list the commits and files affected.
git log --name-status
Once that's done - simply grep
git log --name-status |grep network.rb -A 5 -B 20
commit 98eaede206accb82d5fcb8ec07c1187344e60232
Author: Anthony
Date: Tue May 15 16:52:26 2012 +0100
Deprecate get_cluster_config
Change-Id: Id3472f421c77a8ee18f78db8424333484636e813
D modules/base/lib/facter/network/itxtcluster.rb
D modules/base/lib/facter/network/itxtrank.rb
D modules/base/lib/facter/network/network.rb
D modules/itxt/files/bin/get_cluster_config
M modules/itxt/manifests/files.pp
M modules/itxt/templates/40tomcat-itxt.frag.erb
D modules/pixelling/files/bin/get_cluster_config
M modules/pixelling/manifests/init.pp
Then to restore the file.... find the last commit that affected that file:
Author: Anthony
Date: Tue May 15 16:52:26 2012 +0100
Deprecate get_cluster_config
Change-Id: Id3472f421c77a8ee18f78db8424333484636e813
D modules/base/lib/facter/network/itxtcluster.rb
D modules/base/lib/facter/network/itxtrank.rb
D modules/base/lib/facter/network/network.rb
D modules/itxt/files/bin/get_cluster_config
M modules/itxt/manifests/files.pp
M modules/itxt/templates/40tomcat-itxt.frag.erb
D modules/pixelling/files/bin/get_cluster_config
M modules/pixelling/manifests/init.pp
Then to restore the file.... find the last commit that affected that file:
git rev-list -n 1 HEAD -- <file_path>
check out that version before the commit
git checkout <deleting_commit>^ -- <file_path>
No comments:
Post a Comment