added git plugin to restore deleted file
parent
d3bb347786
commit
e41286888c
|
|
@ -37,6 +37,17 @@ function git_revert() {
|
|||
git reset --hard
|
||||
}
|
||||
|
||||
|
||||
function git_restore_file() {
|
||||
about 'restore the deleted file from HEAD'
|
||||
group 'git'
|
||||
|
||||
[ -z $1 ] && return 1
|
||||
|
||||
COMMIT=$(git rev-list -n 1 HEAD -- "$1")
|
||||
git checkout $COMMIT^ -- "$1"
|
||||
}
|
||||
|
||||
function git_rollback() {
|
||||
about 'resets the current HEAD to this commit'
|
||||
group 'git'
|
||||
|
|
|
|||
Loading…
Reference in New Issue