From 7b90b441242910aca721e3cbf19370cdb5e25954 Mon Sep 17 00:00:00 2001 From: Guangxiong Lin Date: Wed, 14 Sep 2022 14:40:19 +0800 Subject: More git cheatsheet --- git | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'git') diff --git a/git b/git index fdc9baa..8b9cf0a 100644 --- a/git +++ b/git @@ -6,6 +6,12 @@ tags: [ vcs ] # Show contents of a file git show revision:path/to/file +# Recover a file +git restore --source= path/to/file + +# Find which branches contain a specific commit +git branch --contains + # Run commands in all existing commit git filter-branch --tree-filter 'shell command' HEAD -- cgit v1.2.3