笔记本键盘上没有break键的解决方案

世界杯积分规则 2025-10-25 01:57:46 9548

Haisen大王:

restore () {

filepath="$@"

last_commit=$(git log --all --full-history -- $filepath | grep commit | head -1 | awk '{print $2; exit}')

echo "Restoring file from commit before $last_commit"

git checkout $last_commit^ -- $filepath

}

restore my/file_path

这个好,快捷解决了我的问题。

注意路径:my/file_path,是文件距离 项目根目录的 相对路径

站点统计