doc:appunti:prog:git
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
doc:appunti:prog:git [2022/01/09 18:14] – niccolo | doc:appunti:prog:git [2022/01/10 09:57] – [Revert di un singolo file] niccolo | ||
---|---|---|---|
Line 256: | Line 256: | ||
===== Misc Commands ===== | ===== Misc Commands ===== | ||
- | ==== Revert | + | ==== Restore o revert |
+ | |||
+ | A partire da Git 2.23 esiste il comando **git restore** che consente di ripristinare un file modificato localmente alla sua versione di checkout: | ||
+ | |||
+ | < | ||
+ | git restore path/ | ||
+ | </ | ||
+ | |||
+ | Con versioni precedenti di Git si può usare: | ||
+ | |||
+ | < | ||
+ | git checkout -- path/ | ||
+ | </ | ||
+ | |||
+ | Se si desidera tornare ad uno specifico commit, si può visualizzare il log degli stessi e richiederlo esplicitamente: | ||
< | < | ||
git log path/ | git log path/ | ||
- | git checkout <commit> path/ | + | git checkout <commit_id> path/ |
</ | </ | ||
doc/appunti/prog/git.txt · Last modified: 2024/02/12 11:07 by niccolo