git rm -r .
git checkout HEAD~3 .
git commit
After the commit, files in the new HEAD
will be the same as they were in the revision HEAD~3
.
More Related Contents:
- Can I ‘git commit’ a file and ignore its content changes?
- After $git push -u origin main command, Git bash is not requesting any authentication literally does nothing
- What are the differences between double-dot “..” and triple-dot “…” in Git diff commit ranges? [duplicate]
- Git sparse checkout with exclusion
- How to programmatically determine the current checked out Git branch [duplicate]
- Show just the current branch in Git
- Start a Git commit message with a hashmark (#)
- Keep file in a Git repo, but don’t track changes
- What is the difference between “git init” and “git init –bare”?
- Skip Git commit hooks
- How to add chmod permissions to file in Git?
- How to remove files that are listed in the .gitignore but still on the repository?
- Git – Ignore node_modules folder everywhere
- Why am I getting the message, “fatal: This operation must be run in a work tree?”
- Git workflow – Setting up a build process
- What are some more forceful ways than a .gitignore to keep (force) files out of a repository?
- git diff between cloned and original remote repository
- Is there a way to limit the amount of memory that “git gc” uses?
- Git submodules and ssh access
- Setting up a git remote origin
- GitHub – List commits by author
- What is the difference between git am and git apply?
- How to wrap git commit comments?
- How to clone git repository from its zip
- What constitutes a merge conflict in Git?
- git branch permissions
- How can I reduce the ever-increasing time to push a subtree?
- Getting a list of all children of a given commit
- GitHub Api download zip or tarball link
- git status returns fatal: Not a git repository but .git exists and HEAD has proper permissions